Skip to content

Commit fc93b1c

Browse files
committed
Update existing benchmark results and add new ones
Signed-off-by: Anjan Roy <hello@itzmeanjan.in>
1 parent c008817 commit fc93b1c

3 files changed

Lines changed: 290 additions & 285 deletions

README.md

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ This is where "RandomSHAKE" comes, collecting inspiration from <https://seth.roc
1414
> Using the non-deterministic CSPRNG initialization API is very convenient, but there is a caveat - this CSPRNG samples its seed from `std::random_device` engine, which is supposed to be non-deterministic, but is not guaranteed to be - it's implementation-defined behavior. I strongly advise you to read <https://en.cppreference.com/w/cpp/numeric/random/random_device>.
1515
1616
```cpp
17+
// Simply declare CSPRNG, producing pseudo-random uint8_t, backed by TurboSHAKE256 XOF.
18+
randomshake::randomshake_t csprng;
19+
20+
// --- Or, declare alias for shorter type name. ---
21+
1722
// Result type: uint8_t, XOF: TurboSHAKE256. Default case.
1823
using csprng_t = randomshake::randomshake_t<>;
1924

@@ -59,17 +64,17 @@ csprng.generate(rand_values);
5964

6065
### "RandomSHAKE" CSPRNG Performance Overview
6166

62-
CSPRNG Operation | Time taken on AWS EC2 Instance `c7i.large` | Time taken on AWS EC2 Instance `c8g.large`
67+
CSPRNG Operation | Time taken on AWS EC2 Instance `c8i.large` | Time taken on AWS EC2 Instance `c8g.large`
6368
--- | --- | ---
64-
Deterministic seeding of instance | 1.63 us | 1.83 us
65-
Non-Deterministic seeding of instance | 30.34 us | 11.49 us
69+
Deterministic seeding of instance | 1.3 us | 1.8 us
70+
Non-Deterministic seeding of instance | 38.5 us | 11.5 us
6671
--- | --- | ---
67-
Sampling of `u8` | 315.4 MB/s | 202.7 MB/s
68-
Sampling of `u16` | 208.5 MB/s | 278.4 MB/s
69-
Sampling of `u32` | 315.1 MB/s | 388.3 MB/s
70-
Sampling of `u64` | 588.5 MB/s | 491.5 MB/s
71-
Sampling arbitrary long byte sequence (using TurboSHAKE256 XOF, default) | 718.8 MB/s | 637.5 MB/s
72-
Sampling arbitrary long byte sequence (using SHAKE256 XOF, explicit) | 400.1 MB/s | 354.7 MB/s
72+
Sampling of `u8` | 625.4 MB/s | 255.2 MB/s
73+
Sampling of `u16` | 730.3 MB/s | 363.8 MB/s
74+
Sampling of `u32` | 797.1 MB/s | 468.1 MB/s
75+
Sampling of `u64` | 833.3 MB/s | 545.8 MB/s
76+
Sampling arbitrary long byte sequence (using TurboSHAKE256 XOF, default) | 869.2 MB/s | 637.5 MB/s
77+
Sampling arbitrary long byte sequence (using SHAKE256 XOF, explicit) | 485.2 MB/s | 354.7 MB/s
7378

7479
## How to setup ?
7580

@@ -165,7 +170,7 @@ I've run benchmarks on some platforms and here are the results.
165170

166171
### Benchmarking on SERVER-grade Machine(s)
167172

168-
- x86_64. AWS EC2 Instance `c7i.large` i.e. Intel Xeon. JSON dump @ [bench_result_on_Linux_6.14.0-1015-aws_x86_64_with_g++_13](./bench_result_on_Linux_6.14.0-1015-aws_x86_64_with_g++_13.json).
173+
- x86_64. AWS EC2 Instance `c8i.large` i.e. Intel Xeon 6975P-C. JSON dump @ [bench_result_on_Linux_6.14.0-1015-aws_x86_64_with_g++_13](./bench_result_on_Linux_6.14.0-1015-aws_x86_64_with_g++_13.json).
169174
- aarch64. AWS EC2 Instance `c8g.large` i.e. AWS Graviton4. JSON dump @ [bench_result_on_Linux_6.14.0-1015-aws_aarch64_with_g++_13](./bench_result_on_Linux_6.14.0-1015-aws_aarch64_with_g++_13.json).
170175

171176
## How to use ?

0 commit comments

Comments
 (0)