Issue 78496 - sal-strintern - speedup ...
Summary: sal-strintern - speedup ...
Status: CONFIRMED
Alias: None
Product: porting
Classification: Code
Component: code (show other issues)
Version: 680m211
Hardware: All Linux, all
: P3 Trivial (vote)
Target Milestone: 4.x
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-14 17:48 UTC by mmeeks
Modified: 2017-05-20 11:27 UTC (History)
7 users (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
patch (6.24 KB, patch)
2007-06-14 17:50 UTC, mmeeks
no flags Details | Diff
updated patch (5.73 KB, patch)
2007-06-15 10:07 UTC, mmeeks
no flags Details | Diff
fix previous patch ;-) (343 bytes, text/plain)
2007-12-05 16:32 UTC, mmeeks
no flags Details
Patch adapted to DEV300 (6.00 KB, patch)
2010-06-01 15:17 UTC, cedric.bosdonnat.ooo
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description mmeeks 2007-06-14 17:48:41 UTC
So; the STL hash is rather inefficient. This patch replaces it with a simple C
implementation that saves a total of 56million pseudo-cycles ~3% faster.
Comment 1 mmeeks 2007-06-14 17:50:16 UTC
Created attachment 45939 [details]
patch
Comment 2 Stephan Bergmann 2007-06-15 08:11:37 UTC
@mmeeks:  First of all (apart from the usual nitpicking that the STL hash of
course is not rather inefficient, as there is no such thing as the STL hash): 
*What* takes 56million pseudo-cycles less and thus becomes ~3% faster? --- That
is, is it worth it at all?
Comment 3 mmeeks 2007-06-15 09:23:45 UTC
sb: no idea if stl::hash_set suggests a hash or not, a chestnut there ?
sb: the saving is on startup time - during which the intern hash is mostly
populated.
Did I mention it saves 170kb as well ? ;-)
Oh, and now I look, I didn't implement the simple prime table, so I'll do that &
re-measure the performance win.
Comment 4 mmeeks 2007-06-15 10:07:58 UTC
Created attachment 45956 [details]
updated patch
Comment 5 Stephan Bergmann 2007-06-15 10:26:27 UTC
@mmeeks:

- [std::hash_map, despite the name, is a kind of extension available in STLport,
but not Standard C++]

- If the patch is worthwhile (considering the tradeoff between increased code
complexity/refraining from reuse on the one hand and improved space/time
efficiency on the other hand---don't take me wrong, I'm just stating that here
neutrally):

 - commenting out #include "precompiled_sal.hxx" breaks the Windows build, I think

 - why leave the old stuff in #if 0?
Comment 6 mmeeks 2007-06-15 10:46:27 UTC
> If the patch is worthwhile (considering the tradeoff between increased code

Sure - so, in raw %age terms; the hash is around 30% faster; and also somewhat
smaller. Clearly in more 'intern'-heavy code, that should result in >3% wins -
as we use intern more across the code-base, that should work nicely. The code
size increase is 188 lines instead of 84.

>commenting out #include "precompiled_sal.hxx" breaks the Windows build, I think

Good good ;-)

>why leave the old stuff in #if 0?

Makes the patch easy for you to read & on merge should be easy to cut the old
stuff out.
Comment 7 Martin Hollmichel 2007-06-25 13:25:43 UTC
reassign for review.
Comment 8 Stephan Bergmann 2007-06-25 13:41:23 UTC
The review already happened, I would say.  Micheal, feel free to integrate.
Comment 9 mmeeks 2007-11-22 15:54:02 UTC
Stefan - is there any chance we can get this included into some other CWS, to
reduce test-tool, building thrash ?
Comment 10 Stephan Bergmann 2007-11-22 16:19:13 UTC
Sorry, I have no CWS open or planned where we could put this into (done with OOo
2.4).  Either find somebody else who has, or create one yourself.
Comment 11 mmeeks 2007-12-05 16:32:36 UTC
Created attachment 50131 [details]
fix previous patch ;-)
Comment 12 cedric.bosdonnat.ooo 2010-06-01 15:16:25 UTC
integrating in cbosdo06:
http://hg.services.openoffice.org/cws/cbosdo06/rev/dad2c5cc9342
Comment 13 cedric.bosdonnat.ooo 2010-06-01 15:17:21 UTC
Created attachment 69752 [details]
Patch adapted to DEV300
Comment 14 cedric.bosdonnat.ooo 2010-09-09 15:49:28 UTC
sb: could you verify it in cbosdo06?
Comment 15 Stephan Bergmann 2010-09-09 16:36:05 UTC
@cedricbosdo: <http://hg.services.openoffice.org/cws/cbosdo06/rev/dad2c5cc9342>

- still contains #if 0 and "start here" cruft (see <#desc6>)

- still drops precompiled_sal.hxx (see <#desc6>)

- adds extern "C" at various places for no apparent reason (and this was not in
the originally attached sal-strintern-speed.diff); if functions shall be local
to the compilation unit, mark them "static"
Comment 16 cedric.bosdonnat.ooo 2010-09-10 11:32:16 UTC
sb: Those have been fixed in
<http://hg.services.openoffice.org/cws/cbosdo06/rev/b984532be182>
Comment 17 Stephan Bergmann 2010-09-10 12:05:35 UTC
Have they?  Funny "start here" and dubious extern "C" are still there, and why
re-include apparently non-needed rtl/allocator.hxx?
Comment 18 stefan.baltzer 2010-09-17 11:10:54 UTC
Reopening issue.
According to Release Status Meeting this week (see
http://wiki.services.openoffice.org/wiki/ReleaseStatus_Minutes#2010-09-13)
setting target to OOo 3.3.
Comment 19 stefan.baltzer 2010-09-17 11:17:03 UTC
Correction: Set Target to OOo 3.4
sba -> cedricbosdo: As discussed today in IRC, back to you.
Comment 20 Martin Hollmichel 2011-03-16 11:20:57 UTC
set target 3.x since not relevant for 3.4 release.
Comment 21 stefan.baltzer 2011-03-18 17:14:10 UTC
SBA->SB: as discussed with MBA, please proceed, thx.
Comment 22 Rob Weir 2013-03-11 14:59:33 UTC
I'm adding this comment to all open issues with Issue Type == PATCH.  We have 220 such issues, many of them quite old.  I apologize for that.  

We need your help in prioritizing which patches should be integrated into our next release, Apache OpenOffice 4.0.

If you have submitted a patch and think it is applicable for AOO 4.0, please respond with a comment to let us know.

On the other hand, if the patch is no longer relevant, please let us know that as well.

If you have any general questions or want to discuss this further, please send a note to our dev mailing list:  dev@openoffice.apache.org

Thanks!

-Rob
Comment 23 Marcus 2017-05-20 11:27:31 UTC
Reset assigne to the default "issues@openoffice.apache.org".