Commit d1c2d16
authored
[witness gene] optimize StepRecord only copy once (#1250)
### design rationales
previous flow: tracer generate steprecord -> dispatch steprecord to
respective witness table
now: tracer generate steprecord -> dispatch steprecord index only ->
each table take step record index then fetch from steprecord
it improves the performance to avoid per record copy twice within memory
due to the ownership taken.
### benchmark
tested on `23817600` `generate_witness`
| Shard | master (s) | optimized (s) | Improvement (%) |
|-------|------------|----------------|------------------|
| 0 | 6.88 | 4.13 | 39.97% |
| 1 | 3.97 | 2.83 | 28.72% |
| 2 | 3.72 | 2.85 | 23.39% |
| 3 | 3.66 | 2.83 | 22.68% |
| 4 | 2.80 | 2.19 | 21.79% |
| 5 | 2.37 | 1.99 | 16.03% |
| 6 | 4.34 | 4.42 | -1.84% |
| 7 | 6.40 | 3.78 | 40.94% |
| 8 | 5.94 | 3.76 | 36.64% |
| 9 | 5.69 | 3.83 | 32.69% |
| 10 | 5.78 | 3.85 | 33.38% |
| 11 | 3.80 | 2.72 | 28.42% |
| 12 | 3.57 | 2.66 | 25.49% |
| 13 | 3.51 | 2.59 | 26.21% |1 parent 30381b6 commit d1c2d16
File tree
38 files changed
+563
-286
lines changed- ceno_emul
- src
- tests
- ceno_host
- src
- tests
- ceno_zkvm/src
- instructions/riscv
- branch
- dummy
- ecall
- jump
- logic_imm
- logic
- memory
- scheme
38 files changed
+563
-286
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
0 commit comments