Boost logo

Boost :

From: Jean-Louis Leroy (jl_at_[hidden])
Date: 2025-04-30 23:24:16


> Hi, thank you for the answer, review branch prints out hashing stats.

And if you wanted to, you could derive a facet implementation that measures the
time it took to find the hash factors, or implement perfect _minimal_ hashing,
etc.

> Why virtual_ptr doesn't just pick up the policy that was used in initialize? I
> presume to avoid some runtime performance overhead.

Yes.

It annoys me that we have to specify the policy so many times. I have an idea,
but it's whacky, probably a very bad idea: the method and overriders could
infuse the virtual_ptr with the method's policy - just like you don't need to
give the overrider the policy, it gets it from the method.

> Should this behavior be more explicitly mentioned in the documentation. I was
> reading documentation and assumed I can just provide my policy in initialize,
> it was not clear to me what you explained here. I mean now I know how things
> work it is obvious
> https://jll63.github.io/Boost.OpenMethod/#tutorials_policies_and_facets is
> mentioning that initialize and virtual_ptr are "linked", but I think it is
> not obvious when reading it for the first time.

The documentation needs work, obviously.

> Why are we breaking here out of just 1 for loop?

You mean after just one collision? Because we are looking for a perfect (aka
collision-free) very simple and fast hash function: (value * M) >> S. M and S
are found by random search. See a collision? Try another M. After a certain
number of attempts, double S.

J-L


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk