Comments (6)
Hi @GoldsteinE!
This is exactly what is shown in the benchmarks https://github.com/ogxd/gxhash?tab=readme-ov-file#benchmarks.
What is displayed is throughput per input size. Throughput is just another way of viewing the performance. Throughput is in MiB/s, so if you want "latency", you can compute it from throughput. For instance, if we have a throughput of 8000 MiB/s for inputs of size 4 bytes, it means each 4 bytes hash takes 4 / 1014 / 1024 / 8000 s to compute or 4.8 nanoseconds.
I prefer talking in terms of throughput but if you prefer timings per hash you already have everything you need (without having to compute it from throughput):
- The throughput_criterion bench shows both throughput and timings per hash (or iteration if you prefer) for each input size. This bench uses the hash function directly, which does not know in advance about the input size.
- The hashshet bench shows the timings per hash for several string size but also some integer types. Integers size is known in advance so the
Hash
can use fewer steps a thus is a little performant than using the hash function directly in that situation.
Fyi there are some heavy changes ongoing #34 #44 so for now I recommend taking benchmark results with a grain of salt.
from gxhash.
HashSet bench looks interesting, thanks! What I meant is “benchmarks on the small inputs” (as far as I understand, benchmarks in readme are on 40KB inputs, which is a pretty rare case for a HashMap).
from gxhash.
as far as I understand, benchmarks in readme are on 40KB inputs
No, the input size is on the X-axis. It ranges from 4 bytes to 32768 bytes.
from gxhash.
Oh, sorry then, I misread the plot. Thanks again!
from gxhash.
Np! Here is the same bench but tweaked to output time per hash (and with a log scaling on the Y axis). It is maybe closer to what you expected in the first place. These are the results for my MacBook pro M1
![image](https://private-user-images.githubusercontent.com/12692438/292307190-5439863e-08c4-494e-9544-8ade9a9efb89.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTU4Nzg0NTUsIm5iZiI6MTcxNTg3ODE1NSwicGF0aCI6Ii8xMjY5MjQzOC8yOTIzMDcxOTAtNTQzOTg2M2UtMDhjNC00OTRlLTk1NDQtOGFkZTlhOWVmYjg5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA1MTYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNTE2VDE2NDkxNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTA2NzRiZmZjZDFjZTFiNGE0ZTgxYTE0MzA5ZWMyZmVkNmRiYWExNGQwOWE3NmFiMWM2MTkzNjhhYWQ1ODk5ODMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.gwIqsBbgEjv-zRgktkQyFXRZY7AzlLZYDyh7BmzSB4E)
from gxhash.
Np! Here is the same bench but tweaked to output time per hash (and with a log scaling on the Y axis). It is maybe closer to what you expected in the first place. These are the results for my MacBook pro M1
![]()
How did you get results under 1ns? At my intel 1235u i get results not lower then 500ns. Maybe we have different code changes?
My cnahges is just
processor.on_result(len, throughput);
-> processor.on_result(len, average_duration_s * 1_000_000_000.0);
(because average_duration_s = 0.0000005161750103319448 = 516ns)
and enabling log scale at result_processor, but I get completely different numerical results and slightly different shapes of the curves.
from gxhash.
Related Issues (20)
- Don't finalize in Hasher::write, but in finish instead HOT 2
- Possible seed and value recovery HOT 8
- Missing `std` compatibility traits on `GxHasher` and `GxBuildHasher` HOT 1
- How to use AVX2 only for hashmap/set, and use stable hash for hash128/64/32 HOT 12
- how to use AVX2 only for hashmap/set ,and use stable hash for hash128
- Tracking: missing compatibility with `std::HashMap` & `std::HashSet` HOT 5
- Hybrid state gxhash HOT 12
- Major bug: out of bounds read for some input sizes HOT 1
- Primitives specialization for Hasher HOT 4
- cargo bench --no-fail-fast -F=avx2 failed HOT 9
- Quality issue: permutations produce the same hashes? HOT 4
- Add fallback for platforms without AES acceleration
- Readme image link broken HOT 1
- error[E0432]: unresolved import `platform` HOT 13
- how many bytes use write() each time that are most efficient?
- Only hit the RNG once per thread HOT 1
- terminated by signal SIGILL (Illegal instruction) HOT 4
- build script is wrong HOT 2
- write(&[1u8]) and write_u8(1) yield different hashes HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gxhash.