Re: [Stlport-devel] Allow cheaper small hash tables
Brought to you by:
complement
From: Herbert D. <Herbert.Duerr@Sun.COM> - 2006-08-29 07:37:54
|
Thanks for applying the patch. Though hashtables were designed to be most efficient for a couple of thousand entries they are good enough for small collections. Not having to switch the container type when the container grows is worth a lot. In many situations the final size of the container is not known until much later, but the initial costs are a concern. Along these lines I'm considering a change to the hashtable implementation, so that an empty hashtable can be as cheap as the other collections like vector/list/set, etc. So far I'm confident that from a performance perspective the change would only cost one conditional branch which can be predicted almost 100% correctly, so that the branch is as good as free on all recent processors. On the other hand since for binary compatibility reasons OpenOffice.org is married with stlport v4.0 and v4.5 (depending on the platform) I'm not sure yet if modifying and testing 4.0, 4.5 and HEAD are worth it if we are the only customers of an optimzation for empty hash tables. -- Herbert Duerr |