Comments (4)
Interesting result, thank you for sharing this.
It is difficult to draw conclusions from something like the sum of many runs. Would you like to integrate your code into the benchmark.cc? If it is indeed faster there, and you're willing to share your code, we could open-source it here.
2: the input key is given as an integer. Byte order only arises when loaded from bytes, as we do for the input message.
from highwayhash.
I would gladly share the code - I'll integrate into benchmark.cc. In the meantime, here are some more numbers.
UPDATED: Latest numbers:
benchmark_siphash_vs.exe
input len hh::SipHash fh::SipHash speedup hh::HighwayHash speedup
7 1.43s 0.84s 1.71x 0.88s 0.95x
8 1.34s 0.79s 1.70x 0.74s 1.07x
31 0.44s 0.33s 1.34x 0.35s 0.95x
32 0.47s 0.35s 1.34x 0.15s 2.34x
44 0.38s 0.30s 1.26x 0.16s 1.94x
63 0.33s 0.27s 1.20x 0.19s 1.43x
64 0.34s 0.28s 1.20x 0.09s 3.09x
1024 0.23s 0.21s 1.06x 0.04s 5.63x
1048576 0.21s 0.21s 1.02x 0.03s 6.21x
input len hh::SipHash13 fh::SipHash13 speedup
7 1.17s 0.63s 1.85x
8 1.05s 0.51s 2.07x
31 0.32s 0.21s 1.51x
32 0.33s 0.21s 1.53x
44 0.25s 0.18s 1.39x
63 0.21s 0.16s 1.31x
64 0.21s 0.16s 1.31x
1024 0.12s 0.12s 0.95x
1048576 0.11s 0.12s 0.96x
freewayhash::SipHash checksum: 18411327082586722758
highwayhash::SipHash checksum: 18411327082586722758
highwayhash::HighwayHash checksum: 7346031164972754926
benchmark_siphash_gnu.exe
input len hh::SipHash fh::SipHash speedup hh::HighwayHash speedup
7 1.37s 0.75s 1.82x 0.94s 0.80x
8 1.14s 0.71s 1.59x 0.80s 0.89x
31 0.42s 0.30s 1.42x 0.22s 1.36x
32 0.41s 0.33s 1.24x 0.17s 1.91x
44 0.36s 0.28s 1.28x 0.17s 1.63x
63 0.31s 0.25s 1.26x 0.12s 2.00x
64 0.30s 0.27s 1.11x 0.09s 2.87x
1024 0.20s 0.20s 1.00x 0.05s 4.32x
1048576 0.20s 0.20s 1.00x 0.03s 6.55x
input len hh::SipHash13 fh::SipHash13 speedup
7 1.03s 0.56s 1.84x
8 0.81s 0.45s 1.78x
31 0.31s 0.19s 1.68x
32 0.27s 0.19s 1.42x
44 0.24s 0.17s 1.37x
63 0.19s 0.16s 1.20x
64 0.19s 0.16s 1.21x
1024 0.11s 0.12s 0.89x
1048576 0.11s 0.12s 0.89x
freewayhash::SipHash checksum: 18411327082586722758
highwayhash::SipHash checksum: 18411327082586722758
highwayhash::HighwayHash checksum: 7346031164972754926
- My bad. Yes, only when key is given as bytes it should be done.
from highwayhash.
Hi Jan, I have forked the project, if you're interested.
- Added freewayhash::SipHash. "A freeway is a "controlled-access" highway — also known as an express highway — that's designed exclusively for high-speed vehicular traffic.". As from above table, it is approx. 2x - 1.2x faster for 7 - 63 bytes input lengths.
- Integrated into benchmark.cc, but I find my own benchmarks show better differentiation: Larger differences on short inputs. On the flip side, your HighwayHash seems more like 6x faster than SipHash on long inputs, rather than your claimed 5x. Maybe your benchmarking framework has some overhead that flattens the results a bit?
- I also included a "no-branch" (no if), simpler freewayhash::v2::SipHash that requires multiples of 8 bytes in Update(), where you put the remaining in Finalize(). But technically, as it contains a conditional loop it is not branch free?
from highwayhash.
Hi, thanks for integrating and testing! I didn't see the benchmark.cc results in your commit/readme - can you share those?
I find my own benchmarks show better differentiation: Larger differences on short inputs
Maybe your benchmarking framework has some overhead that flattens the results a bit?
Yes, this is by design. A long loop will lead to near-perfect icache and branch prediction, whereas our benchmark deliberately interferes with this by randomizing the input lengths.
from highwayhash.
Related Issues (20)
- Unexpected low speeds with the generic C?! HOT 2
- New Nodejs bindings package HOT 2
- highwayhash-wasm - WASM JS binding for the browser and nodejs HOT 3
- Alignment attributes are in the wrong place for arrays HOT 1
- Build fails (gcc (Ubuntu 12.2.0-3ubuntu1) 12.2.0) HOT 6
- Small bug in documentation (?) HOT 1
- Question: When the README says "an expected 2^32 guesses of m per the birthday paradox", does it refers to 128 and 256-bits versions too? HOT 3
- Alignment warning when compiling with GCC7 on aarch64 HOT 2
- Issues with Core 2 Duo HOT 1
- [Partial implementation] NEON version HOT 1
- Question: SSSE3 HOT 3
- doc: wikipedia article has been deleted HOT 1
- Failed to build on arm64 HOT 1
- Please strip the installed library HOT 1
- Installs an unstripped binary lib/libhighwayhash.so HOT 3
- Builds static library with relocatable code (-fPIC) HOT 3
- Problem with Python 3 bindings HOT 5
- Test fails with gcc 10.2.0 HOT 3
- The tricky __SSE4_1__ macro under Visual Studio 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 highwayhash.