Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Benchmarks on larger sets #60

Open
ghost opened this issue Nov 18, 2018 · 2 comments
Open

Benchmarks on larger sets #60

ghost opened this issue Nov 18, 2018 · 2 comments

Comments

@ghost
Copy link

ghost commented Nov 18, 2018

Seems like having int array of 32 numbers makes std::array look great vs frozen. However once we go for 64 numbers etc frozen looks way better. I guess it'd be interesting to improve benchmarks to show perfect hash potential on larger sets.

@ghost
Copy link
Author

ghost commented Nov 20, 2018

GCC 8.1.0 unmodified benchmark

2018-11-20 14:43:47
Running ./benchmarks/frozen.benchmark
Run on (8 X 3800 MHz CPU s)
CPU Caches:
  L1 Data 32K (x4)
  L1 Instruction 32K (x4)
  L2 Unified 256K (x4)
  L3 Unified 8192K (x1)
Load Average: 0.54, 0.64, 1.98
***WARNING*** CPU scaling is enabled, the benchmark real time measurements may be noisy and will incur extra overhead.
------------------------------------------------------------------
Benchmark                           Time           CPU Iterations
------------------------------------------------------------------
BM_IntInFzSet                      91 ns         91 ns    7707237
BM_IntInStdSet                    179 ns        179 ns    3910143
BM_IntInStdArray                   49 ns         49 ns   14465849
BM_IntNotInFzSet                   91 ns         91 ns    7658368
BM_IntNotInStdSet                 137 ns        137 ns    5083290
BM_IntNotInStdArray                27 ns         27 ns   25582279

GCC 8.1.0 Keywords set increased to 64 integers

$ ./benchmarks/frozen.benchmark 
2018-11-20 14:40:01
Running ./benchmarks/frozen.benchmark
Run on (8 X 3800 MHz CPU s)
CPU Caches:
  L1 Data 32K (x4)
  L1 Instruction 32K (x4)
  L2 Unified 256K (x4)
  L3 Unified 8192K (x1)
Load Average: 0.15, 0.69, 2.37
***WARNING*** CPU scaling is enabled, the benchmark real time measurements may be noisy and will incur extra overhead.
------------------------------------------------------------------
Benchmark                           Time           CPU Iterations
------------------------------------------------------------------
BM_IntInFzSet                     213 ns        213 ns    3298455
BM_IntInStdSet                    391 ns        391 ns    1808459
BM_IntInStdArray                  748 ns        747 ns     925253
BM_IntNotInFzSet                  106 ns        106 ns    6576485
BM_IntNotInStdSet                 137 ns        137 ns    5061951
BM_IntNotInStdArray               702 ns        702 ns     982936

@serge-sans-paille
Copy link
Owner

@divaykin I think both results are interesting. You can propose a PR for an extra set of benchmark with larger dataset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant