stefankarschti / inputosm

A high performance reader of OSM data files.
Other
2 stars 1 forks source link

remove potential false sharing on counters #5

Closed bencsikandrei closed 1 year ago

bencsikandrei commented 1 year ago

add a simple counter that aligns on 64B (size of a chache line) use that instead of having 8 B uint64s consecutive and touched by different threads the impact is larger if the processing itself is fast, otherwise the bottleneck is somewhere else, still, not invalidating cache lines is nice

stefankarschti commented 1 year ago

Great stuff! The only drawback is the extra memory usage, but that can be avoided by grouping elements in structs aligned to 64B.