stclib / STC

A modern, user friendly, generic, type-safe and fast C99 container library: String, Vector, Sorted and Unordered Map and Set, Deque, Forward List, Smart Pointers, Bitset and Random numbers.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ins_and_access_cmap_s doesn't seem to do the same thing as ins_and_access_s

camel-cdr opened this issue · comments

I'm pretty sure randomize(str.str, cstr_size(str)); shouldn't be commented out here, since the other benchmarks still have this line. Due to this, ins_and_access_cmap_s currently needs to do one less lookup than ins_and_access_s.

https://github.com/tylov/STC/blob/e7585be46ff8a7f37b57d944f90b401978db4e53/benchmarks/picobench/picobench_cmap.cpp#L208-L212

https://github.com/tylov/STC/blob/e7585be46ff8a7f37b57d944f90b401978db4e53/benchmarks/picobench/picobench_cmap.cpp#L190-L193

Yes, I think you are right. I don't think benchmark is very realistic though, from other tests I've done, tsl seems to be fastest, and cmap is actually almost equally fast with clang. On gcc, cmap is to be more in the middle. martinus robin_hood has actually gotten a little slower during last years changes, but its still very fast with strings.