Skip to content

recsplit: optimize findSplit and findBijection#19043

Merged
Giulio2002 merged 16 commits into
mainfrom
alex/rs_func2_34
Feb 10, 2026
Merged

recsplit: optimize findSplit and findBijection#19043
Giulio2002 merged 16 commits into
mainfrom
alex/rs_func2_34

Conversation

@AskAlexSharov

@AskAlexSharov AskAlexSharov commented Feb 9, 2026

Copy link
Copy Markdown
Collaborator

4-unrolling:

benchstat old.txt new.txt
goos: linux
goarch: amd64
pkg: github.com/erigontech/erigon/db/recsplit
cpu: AMD EPYC 4344P 8-Core Processor
                          │   old.txt    │               new.txt               │
                          │    sec/op    │   sec/op     vs base                │
FindSplit-16                13.32m ±  1%   11.51m ± 1%  -13.64% (p=0.000 n=10)
FindBijection-16            6.167m ±  0%   5.531m ± 0%  -10.31% (p=0.000 n=10)
Build-16                     1.971 ±  0%    1.780 ± 0%   -9.72% (p=0.000 n=10)
AddKeyAndBuild/noEnums-16    2.357 ± 27%    2.147 ± 1%   -8.90% (p=0.000 n=10)
AddKeyAndBuild/enums-16      2.441 ± 11%    2.229 ± 2%   -8.67% (p=0.000 n=10)

8-unrolling:

goos: linux
goarch: amd64
pkg: github.com/erigontech/erigon/db/recsplit
cpu: AMD EPYC 4344P 8-Core Processor
                          │   old.txt    │               new.txt               │
                          │    sec/op    │   sec/op     vs base                │
FindSplit-16                13.32m ±  1%   10.52m ± 0%  -21.00% (p=0.000 n=10)
FindBijection-16            6.167m ±  0%   4.799m ± 1%  -22.18% (p=0.000 n=10)
Build-16                     1.971 ±  0%    1.617 ± 1%  -17.96% (p=0.000 n=10)
AddKeyAndBuild/noEnums-16    2.357 ± 27%    1.989 ± 1%  -15.59% (p=0.000 n=10)
AddKeyAndBuild/enums-16      2.441 ± 11%    2.067 ± 6%  -15.32% (p=0.000 n=10)

based on #19041

@Giulio2002

Copy link
Copy Markdown
Contributor

great work big Alex!

@Giulio2002 Giulio2002 enabled auto-merge (squash) February 9, 2026 15:16
@Giulio2002 Giulio2002 merged commit ed14c6b into main Feb 10, 2026
19 checks passed
@Giulio2002 Giulio2002 deleted the alex/rs_func2_34 branch February 10, 2026 03:29
sudeepdino008 pushed a commit that referenced this pull request Feb 10, 2026
4-unrolling:
```
benchstat old.txt new.txt
goos: linux
goarch: amd64
pkg: github.com/erigontech/erigon/db/recsplit
cpu: AMD EPYC 4344P 8-Core Processor
                          │   old.txt    │               new.txt               │
                          │    sec/op    │   sec/op     vs base                │
FindSplit-16                13.32m ±  1%   11.51m ± 1%  -13.64% (p=0.000 n=10)
FindBijection-16            6.167m ±  0%   5.531m ± 0%  -10.31% (p=0.000 n=10)
Build-16                     1.971 ±  0%    1.780 ± 0%   -9.72% (p=0.000 n=10)
AddKeyAndBuild/noEnums-16    2.357 ± 27%    2.147 ± 1%   -8.90% (p=0.000 n=10)
AddKeyAndBuild/enums-16      2.441 ± 11%    2.229 ± 2%   -8.67% (p=0.000 n=10)
```

8-unrolling:
```
goos: linux
goarch: amd64
pkg: github.com/erigontech/erigon/db/recsplit
cpu: AMD EPYC 4344P 8-Core Processor
                          │   old.txt    │               new.txt               │
                          │    sec/op    │   sec/op     vs base                │
FindSplit-16                13.32m ±  1%   10.52m ± 0%  -21.00% (p=0.000 n=10)
FindBijection-16            6.167m ±  0%   4.799m ± 1%  -22.18% (p=0.000 n=10)
Build-16                     1.971 ±  0%    1.617 ± 1%  -17.96% (p=0.000 n=10)
AddKeyAndBuild/noEnums-16    2.357 ± 27%    1.989 ± 1%  -15.59% (p=0.000 n=10)
AddKeyAndBuild/enums-16      2.441 ± 11%    2.067 ± 6%  -15.32% (p=0.000 n=10)
```
based on #19041
Sahil-4555 pushed a commit to Sahil-4555/erigon that referenced this pull request Feb 11, 2026
4-unrolling:
```
benchstat old.txt new.txt
goos: linux
goarch: amd64
pkg: github.com/erigontech/erigon/db/recsplit
cpu: AMD EPYC 4344P 8-Core Processor
                          │   old.txt    │               new.txt               │
                          │    sec/op    │   sec/op     vs base                │
FindSplit-16                13.32m ±  1%   11.51m ± 1%  -13.64% (p=0.000 n=10)
FindBijection-16            6.167m ±  0%   5.531m ± 0%  -10.31% (p=0.000 n=10)
Build-16                     1.971 ±  0%    1.780 ± 0%   -9.72% (p=0.000 n=10)
AddKeyAndBuild/noEnums-16    2.357 ± 27%    2.147 ± 1%   -8.90% (p=0.000 n=10)
AddKeyAndBuild/enums-16      2.441 ± 11%    2.229 ± 2%   -8.67% (p=0.000 n=10)
```

8-unrolling:
```
goos: linux
goarch: amd64
pkg: github.com/erigontech/erigon/db/recsplit
cpu: AMD EPYC 4344P 8-Core Processor
                          │   old.txt    │               new.txt               │
                          │    sec/op    │   sec/op     vs base                │
FindSplit-16                13.32m ±  1%   10.52m ± 0%  -21.00% (p=0.000 n=10)
FindBijection-16            6.167m ±  0%   4.799m ± 1%  -22.18% (p=0.000 n=10)
Build-16                     1.971 ±  0%    1.617 ± 1%  -17.96% (p=0.000 n=10)
AddKeyAndBuild/noEnums-16    2.357 ± 27%    1.989 ± 1%  -15.59% (p=0.000 n=10)
AddKeyAndBuild/enums-16      2.441 ± 11%    2.067 ± 6%  -15.32% (p=0.000 n=10)
```
based on erigontech#19041
@AskAlexSharov AskAlexSharov mentioned this pull request Mar 2, 2026
16 tasks
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

Successfully merging this pull request may close these issues.

2 participants