From: Tom H. <tom...@pa...> - 2010-07-26 06:33:42
|
On Mon, 2010-07-26 at 12:17 +0800, Brett Nash wrote: > If I were you I'd do some benchmarks and see what falls out. > > For instance eina_strinshare add has a wacky +3 to the strlen, which > means the common case of a aligned string gets a hit on architectures > using sse optimised strlens or 64 bit arches using plain register > compares. Sure, don't worry, benchmarks are planned :P > > > Stringshare can't be used for Binshare (because of the null > > termination) but, if we give up on the 1 char strings special case, > > we can save a lot of code duplication. > > That smells like a win to me. Even better if we have one cache, rather > the two at run time. That's what I though doing first (one cache), but then I decided this is just a hassle and having two (actually more, depending on "share engine", currently I have stringshare, u(nicode)stringshare and binshare), whoever wants any should start them. Making the Unicode/regular differentiation made a lot of sense to me, since both are (I'm also changing the efl font engine, and textblock/text objects to use unicode internally) heavily used on their own, the likelihood of having the same string twice is VERY low. I can change it to one cache back, but I honestly thinks it makes no sense. > Just do some benchmarks, if the optimisations are not a gain or small > gain and get in your way, drop them. Well, already added them back, I don't trust the small benchmarks I did enough. I just added them in a clean way ("manual" overrides in the wrapping functions). -- Tom. |