diff options
| author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-04-18 05:55:49 -0300 |
|---|---|---|
| committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-04-18 19:57:26 -0300 |
| commit | 98266da47c1578bbd0e166cdba900c4f2405f6ba (patch) | |
| tree | 1a2cf1845750a8873e61c50074952b1d36fb2726 /src/video_core/buffer_cache/buffer_cache.h | |
| parent | 89c816a3cf83a7bbe1369117c49c4595272056a6 (diff) | |
fixed_pipeline_state: Hash and compare the whole structure
Pad FixedPipelineState's size to 384 bytes to be a multiple of 16.
Compare the whole struct with std::memcmp and hash with CityHash. Using
CityHash instead of a naive hash should reduce the number of collisions.
Improve used type traits to ensure this operation is safe.
With these changes the improvements to the hashable pipeline state are:
Optimized structure
Hash: 89 ns
Comparison: 103 ns
Construction*: 164 ns
Struct size: 384 bytes
Original structure
Hash: 148 ns
Equal: 174 ns
Construction*: 281 ns
Size: 1384 bytes
* Attribute state initialization is not measured
These measures are averages taken with std::chrono::high_accuracy_clock
on MSVC shipped on Visual Studio 16.6.0 Preview 2.1.
Diffstat (limited to 'src/video_core/buffer_cache/buffer_cache.h')
0 files changed, 0 insertions, 0 deletions
