On Wed, Nov 09, 2022 at 12:29:49PM +0100, Jean-Marc Lasgouttes wrote: > Le 08/11/2022 ?? 20:44, Pavel Sanda a écrit : > >I do not follow what's your problem with QHash? Hash tables are designed too > >have > >collisions from time to time. > > My problem here is that I have a cache > [string, screen width] -> [points where to break the string] > > In the example file submitted by Scott in #12598, the string is 500kB long, > and therefore, this will need to be stored in the cache. > > In general, I will need to store in the cache an amount of data ~equal to > the document size, and I think it is not really necessary. > > This is why I am looking for a fast and almost-collision-free hash to store > in the key. > > Is it clearer now ?
I think I understand what you need. What I do not understand why you consider QHash not good enough for your purposes. "Almost collision-free" is another name to get amortized complexity of O(1) for insertion/lookup and QHash is supposed to have it, no? Pavel -- lyx-devel mailing list [email protected] http://lists.lyx.org/mailman/listinfo/lyx-devel
