PTRHash icon indicating copy to clipboard operation
PTRHash copied to clipboard

Added compile-time support

Open yyy33 opened this issue 1 year ago • 3 comments

Hello, do you have plans for ptrhash to support create and find at compile time

yyy33 avatar May 25 '24 06:05 yyy33

Hey! Thanks for your interest in ptrhash :)

I'm not currently planning to support this, but if you have I compelling usecase you may be able to convince me otherwise. Would you mind explaining what you would use it for?

Since the main usecase of ptrhash is for (very) large datasets, I don't think compile time construction makes that much sense, and typically it should be fast to do it at runtime also.

RagnarGrootKoerkamp avatar May 25 '24 18:05 RagnarGrootKoerkamp

Hey! Thanks for your interest in ptrhash :)

I'm not currently planning to support this, but if you have I compelling usecase you may be able to convince me otherwise. Would you mind explaining what you would use it for?

Since the main usecase of ptrhash is for (very) large datasets, I don't think compile time construction makes that much sense, and typically it should be fast to do it at runtime also.

Uh, my use case may be a bit trivial, I want to write a namp, similar to a hashmap, but allowing to add mapping relationships between n data types. So now I need a mapping table (Map<TypeId, ErasedVec) that allows build and lookup at compile time.

yyy33 avatar May 26 '24 16:05 yyy33

If the lookup is also at compile time, a vector of TypeId with linear search should for sure be fine.

In case you'll also do queries at runtime I could see this being useful. But for now I won't have time to work on this project; maybe in a month or two.

RagnarGrootKoerkamp avatar May 29 '24 15:05 RagnarGrootKoerkamp

Going to close this as won't fix, since it's really out of scope of the project.

RagnarGrootKoerkamp avatar Nov 11 '24 22:11 RagnarGrootKoerkamp