Skip to content

Commit

Permalink
feat: add benchmark yaml workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
0xWOLAND committed Nov 19, 2023
1 parent 1a34dab commit 085053f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 41 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ jobs:
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
- name: Run benchmarks
run: cargo criterion --message-format=json | criterion-table > BENCHMARKS.md
41 changes: 0 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,44 +24,3 @@ fast-ntt is a Rust package to compute polynomial multiplication in `O(nlog(n))`
let a = Polynomial::new(vec![3, 2, 1].iter().map(|&x| BigInt::from(x)).collect());
let da = a.diff();
```

## Benchmarks

Computer Stats:

```
CPU(s): 16
Thread(s) per core: 2
Core(s) per socket: 8
Socket(s): 1
```

### Number-Theoretic Transform

| Polynomial Degree | NTT |
| ----------------- | --------- |
| 64 | 201.11 µs |
| 128 | 355.35 µs |
| 256 | 845.66 µs |
| 512 | 1.3013 ms |
| 1024 | 2.1763 ms |
| 2048 | 4.1270 ms |
| 4096 | 7.9391 ms |
| 8192 | 16.674 ms |
| 16384 | 34.160 ms |
| 32768 | 79.303 ms |

### Polynomial Multiplication

| Polynomial Degree | NTT-Based | Brute-Force |
| ----------------- | --------- | ----------- |
| 64 | 1.2677 ms | 50.389 µs |
| 128 | 2.3206 ms | 196.92 µs |
| 256 | 3.6952 ms | 777.25 µs |
| 512 | 6.9324 ms | 3.2495 ms |
| 1024 | 13.158 ms | 12.777 ms |
| 2048 | 26.159 ms | 51.868 ms |
| 4096 | 55.093 ms | 205.77 ms |
| 8192 | 115.62 ms | 812.68 ms |
| 16384 | 241.09 ms | 3.2130 s |
| 32768 | 502.79 ms | 12.959 s |

0 comments on commit 085053f

Please sign in to comment.