You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openoffice.apache.org by li zhang <li...@gmail.com> on 2012/08/24 08:06:10 UTC

[call for review] optimize a comparing operation from 'memcmp' to 'hash compare' to improve xls loading performance.

hi, all
I have one fix need for review. Please check the below for details, thanks!

https://issues.apache.org/ooo/show_bug.cgi?id=120575

Root cause:
in xls loading procedure, ScPatternAttr::operator== occupies too much time,
in this function, two sfxitemset are compared by memcmp(...), this is a
time consuming operation.

Resolution:
Instead of memcmp(...), two sfxitemset can be compared 'quickly' by the
hashkey only. And a function SfxItemSet::QuickCompare( SfxItemSet & rCmp)
instead of EqualPatternSets(...).

Test result:
In ScPatternAttr::operator==, SfxItemSet::QuickCompare( SfxItemSet & rCmp)
will be called 3141717 times, including 3114837 times only comparing hash
key and directly return, memcmp(...). will be called 26880 times(sample
file).