loader.loadComponentFromURL works slow when we are restoring CALC sheet from byte array | loader.loadComponentFromURL

Michael Meeks michael.meeks at suse.com
Fri Dec 7 03:05:49 PST 2012

On Thu, 2012-12-06 at 09:19 -0500, William Beltrán wrote:
> Ok.

	Thanks :-)

> >> 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.

	It'd be good to know what is in that sequence :-) is it zipped ODF
data, flat ODF ? etc.

> If I open the file in LibreOffice and saves it as xls file that is very 
> fast.

	Sounds very odd; if this is a linux machine - can you run a sampling
profiler like oprofile to work out what is happening there - almost
certainly something very dumb is going on - we should be able to stream
data from a python bytesequence at great speed: it should be ~all native
code from there on in IMHO - so something very odd going on :-) perhaps
some unusual filter / type detection stuff (?).

	Thanks !


michael.meeks at suse.com  <><, Pseudo Engineer, itinerant idiot

More information about the LibreOffice mailing list