On 08/17/2012 07:20 PM, Kohei Yoshida wrote:
Interesting thing is, we used to have similar performance problem with
styles import with Excel files. And I did take a very similar approach
to what you just tried. The difference is that, I set the styles
directly to ScDocument using the same data structure that's used in
ScAttrArray to store the styles attributes, to avoid unnecessary
conversation of data, and also unnecessary broadcasting etc that it
would normally do when modifying its internal content. That resulted
in a pretty big performance improvement. You can take a look at
ScDocument::SetAttrEntries and its call chain all the way down to
ScAttrArray. So, the approach I would aim for is to change the XML
import code to use ScDocument::SetAttrEntries to set the styles
directly, then see if that would improve the performance. I'm pretty
sure that, as long as we keep using the UNO layer to set properties
there isn't much we can do to improve performance further. We need to
break that layer first. I wonder if the biggest problem now for a file
I'm not sure if it would apply as much to this particular file, but I
could be wrong. Even so, your words give me hope.
My ultimate goal was to remove the UNO and ScDocFunc layers, but I first
wanted to try my concept without removing them in order to make sure it
would work and to minimize the amount of code I was initially changing.
I think I got lost in the forest during the process and forgot about the
possibility that complete removal of the UNO/ScDocFunc layer here in
addition to what I had already done would have a much more significant
effect on performance (as you said, because of avoiding the data
conversion and broadcasts.) I feel kind of silly now but hopeful. I'll
take a look at the suggested code and reevaluate.
Thanks, Kohei!
--Daniel
_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice