Skip to content

Swap fnv for fx hashing in gpu-cache hashmaps (#119)

Alex Butler requested to merge (removed):master into master

I was experimenting with fast integer hashing this weekend, I found rustc-hash'sFxHasher to generally be faster than fnv for such keys. This proves true here in the gpu_cache usage with around 30% improved benchmark performance.

name                                                         control ns/iter  change ns/iter  diff ns/iter   diff %  speedup 
gpu_cache::cache_bench_tests::bench_high_position_tolerance  1,174,522        893,982             -280,540  -23.89%   x 1.31 
gpu_cache::cache_bench_tests::bench_moving_text              1,462,233        1,143,286           -318,947  -21.81%   x 1.28 
gpu_cache::cache_bench_tests::bench_multi_font               1,375,437        1,056,838           -318,599  -23.16%   x 1.30 
gpu_cache::cache_bench_tests::bench_multi_font_population    8,133,369        8,092,911            -40,458   -0.50%   x 1.00 
gpu_cache::cache_bench_tests::bench_single_font              1,318,413        1,007,040           -311,373  -23.62%   x 1.31 

Also a minor tweak to the rasterizer, just moving the .rev() calls where they make more sense (they are there just to make the swap_remove(i) calls work).

I didn't fully note you guys have moved off github, so I merged this there.

Merge request reports