loader.loadComponentFromURL works slow when we are restoring CALC sheet from byte array | loader.loadComponentFromURL
William Beltrán
wigebeno at hotmail.com
Thu Dec 6 06:19:22 PST 2012
El 06/12/12 08:50, Michael Meeks escribió:
> On Wed, 2012-12-05 at 11:27 -0500, William Beltrán wrote:
>> Ok, I try to be more specific
> Warning: Any further replies that ignore my request to CC (this means
> carbon-copy - it is usually the 2nd field down in your mailer after the
> To: field) the public developers list - will be ignored. You need to
> enter: libreoffice at lists.freedesktop.org into that CC field when you
> reply: why ? I don't want to burn my time answering the same questions
> again and again to lots of different users :-)
Ok.
>
>> I am usign aeroo_reports(aerolib) to generate a ods report, this
>> report is vey complex and it takes arround 20secs to work and generate
>> it in .ods type, I can configure the report_aeroo module to
>> automatically convert the result of my process to xls file but the
>> times grows up to 15 minutes!!! only in transformation process, so I
>> analize the module code and i found that this function is the problem:
> Fine.
>
>> def putDocument(self, data):
>> try:
>> desktop =
>> self._context.ServiceManager.createInstanceWithContext("com.sun.star.frame.Desktop", self._context)
>> except UnknownPropertyException:
>> self._context = self._resolver.resolve("uno:socket,host=%
>> s,port=%s;urp;StarOffice.ComponentContext" % (self._host, self._port))
>> desktop =
>> self._context.ServiceManager.createInstanceWithContext("com.sun.star.frame.Desktop", self._context)
>> inputStream =
>> self.serviceManager.createInstanceWithContext("com.sun.star.io.SequenceInputStream", self.localContext)
>> inputStream.initialize((uno.ByteSequence(data),))
> Looks like you convert some huge string into a byte sequence. I guess,
> that should be reasonably quick. What does your huge string contain ?
> zipped ODF ? flat-ODF ? what ?
Is the contain of the file (bytesequence), just like another odf file
that really is a zip file as you knows.
>
>> self.document = desktop.loadComponentFromURL('private:stream',
>> "_blank", 0, self._toProperties(InputStream = inputStream))
>> inputStream.closeInput()
> That takes the time ? if so - we'd need a profile of what is going on
> to be able to point you at the slow bit so you can help fix it.
>
>> Where var data is an inputsream containing the bytes of the ods
>> file,but there is no problem until the line:
>>
>> self.document = desktop.loadComponentFromURL('private:stream',
>> "_blank", 0, self._toProperties(InputStream = inputStream))
>>
>> This line is the "devil" so I have to waint until 15 minutes to be
>> done and excecute next line(inputStream.closeInput())
>> The reports has maybe has 4230 rows so its a big report
> 4000 rows is not that many; there must be something unusual about them,
> or about the SequenceInputStream: which looks like it should be really
> fast. If you have a non-confidential example of the file-data there -
> can you dump that to a file and try loading that standalone ?
>
> ATB,
>
> Michael.
>
If I open the file in LibreOffice and saves it as xls file that is very
fast.
More information about the LibreOffice
mailing list