-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
eliasfano32: optimise reverse iterator (#10395)
- Reduces memory allocations for reverse iterator from 49681997 B/op to 144 B/op - Adds support for reverse binary search Seek to reverse iterator (we can use that in `FrozenInvertedIdxIter.advanceInFiles` for more performance - will add in a subsequent [PR](#10397)) ``` ➜ go test -bench=. -benchmem goos: darwin goarch: arm64 pkg: github.com/ledgerwatch/erigon-lib/recsplit/eliasfano32 BenchmarkName/next_to_value_1_000_000-8 1113 1091076 ns/op 144 B/op 1 allocs/op BenchmarkName/seek_to_value_1_000_000-8 2000680 601.1 ns/op 144 B/op 1 allocs/op BenchmarkName/reverse_next_to_value_1_230-8 8 129665120 ns/op 152 B/op 2 allocs/op BenchmarkName/reverse_seek_to_value_1_230-8 1000000 1062 ns/op 152 B/op 2 allocs/op BenchmarkName/naive_reverse_iterator-8 8 135305406 ns/op 49681997 B/op 42 allocs/op BenchmarkName/reverse_iterator-8 8 127542469 ns/op 144 B/op 1 allocs/op PASS ok github.com/ledgerwatch/erigon-lib/recsplit/eliasfano32 12.937s ```
- Loading branch information
Showing
3 changed files
with
400 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.