Skip to content

Conversation

@libotony
Copy link
Member

@libotony libotony commented Jan 9, 2026

Description

Ticket https://github.com/vechain/protocol-board-repo/issues/1004

The benchmark result shows that the PR has the same performance as the previous change.

benchstat target1.txt pr1.txt
goos: darwin
goarch: arm64
pkg: github.com/vechain/thor/v2/logdb
cpu: Apple M1 Max
                                               │ target1.txt  │               pr1.txt               │
                                               │    sec/op    │    sec/op     vs base               │
FakeDB_NewestBlockID/newest_block_id-10          194.2µ ± ∞ ¹   203.0µ ± ∞ ¹        ~ (p=0.690 n=5)
FakeDB_WriteBlocks/repeated_writes-10             5.637 ± ∞ ¹    5.765 ± ∞ ¹        ~ (p=0.841 n=5)
FakeDB_WriteBlocks/batched_writes-10              2.651 ± ∞ ¹    2.617 ± ∞ ¹        ~ (p=0.310 n=5)
TestDB_FilterEvents/AddressCriteriaFilter-10      12.24 ± ∞ ¹    14.11 ± ∞ ¹  +15.32% (p=0.008 n=5)
TestDB_FilterEvents/TopicCriteriaFilter-10        96.07 ± ∞ ¹    96.12 ± ∞ ¹        ~ (p=0.690 n=5)
TestDB_FilterEvents/EventLimit-10                 2.010 ± ∞ ¹    1.958 ± ∞ ¹        ~ (p=0.095 n=5)
TestDB_FilterEvents/EventLimitDesc-10             2.747 ± ∞ ¹    2.670 ± ∞ ¹        ~ (p=0.151 n=5)
TestDB_FilterEvents/EventRange-10                 1.335 ± ∞ ¹    1.256 ± ∞ ¹        ~ (p=0.310 n=5)
TestDB_FilterEvents/EventRangeDesc-10             1.285 ± ∞ ¹    1.245 ± ∞ ¹   -3.16% (p=0.008 n=5)
TestDB_FilterTransfers/TransferCriteria-10       171.0µ ± ∞ ¹   166.4µ ± ∞ ¹        ~ (p=0.056 n=5)
TestDB_FilterTransfers/TransferCriteriaDesc-10   173.6µ ± ∞ ¹   166.4µ ± ∞ ¹        ~ (p=0.056 n=5)
TestDB_FilterTransfers/Ranged500K-10             337.2m ± ∞ ¹   339.1m ± ∞ ¹        ~ (p=1.000 n=5)
TestDB_FilterTransfers/Ranged500KDesc-10         338.1m ± ∞ ¹   333.6m ± ∞ ¹        ~ (p=0.056 n=5)
geomean                                          291.4m         290.8m         -0.22%
¹ need >= 6 samples for confidence interval at level 0.95

                                               │  target1.txt  │               pr1.txt               │
                                               │     B/op      │     B/op       vs base              │
FakeDB_NewestBlockID/newest_block_id-10          6.640Ki ± ∞ ¹   6.639Ki ± ∞ ¹       ~ (p=0.460 n=5)
FakeDB_WriteBlocks/repeated_writes-10            140.4Mi ± ∞ ¹   140.4Mi ± ∞ ¹       ~ (p=1.000 n=5)
FakeDB_WriteBlocks/batched_writes-10             136.6Mi ± ∞ ¹   136.6Mi ± ∞ ¹       ~ (p=0.690 n=5)
TestDB_FilterEvents/AddressCriteriaFilter-10     613.0Mi ± ∞ ¹   613.0Mi ± ∞ ¹       ~ (p=0.151 n=5)
TestDB_FilterEvents/TopicCriteriaFilter-10       610.3Mi ± ∞ ¹   610.3Mi ± ∞ ¹       ~ (p=0.127 n=5)
TestDB_FilterEvents/EventLimit-10                639.9Mi ± ∞ ¹   639.9Mi ± ∞ ¹       ~ (p=0.111 n=5)
TestDB_FilterEvents/EventLimitDesc-10            677.2Mi ± ∞ ¹   677.2Mi ± ∞ ¹  +0.00% (p=0.048 n=5)
TestDB_FilterEvents/EventRange-10                320.3Mi ± ∞ ¹   320.3Mi ± ∞ ¹       ~ (p=0.548 n=5)
TestDB_FilterEvents/EventRangeDesc-10            320.3Mi ± ∞ ¹   320.3Mi ± ∞ ¹       ~ (p=0.206 n=5)
TestDB_FilterTransfers/TransferCriteria-10       39.86Ki ± ∞ ¹   39.86Ki ± ∞ ¹       ~ (p=0.175 n=5)
TestDB_FilterTransfers/TransferCriteriaDesc-10   39.86Ki ± ∞ ¹   39.86Ki ± ∞ ¹  -0.00% (p=0.024 n=5)
TestDB_FilterTransfers/Ranged500K-10             70.44Mi ± ∞ ¹   70.44Mi ± ∞ ¹       ~ (p=0.095 n=5)
TestDB_FilterTransfers/Ranged500KDesc-10         70.44Mi ± ∞ ¹   70.44Mi ± ∞ ¹       ~ (p=0.095 n=5)
geomean                                          29.94Mi         29.94Mi        -0.00%
¹ need >= 6 samples for confidence interval at level 0.95

                                               │ target1.txt  │               pr1.txt                │
                                               │  allocs/op   │  allocs/op    vs base                │
FakeDB_NewestBlockID/newest_block_id-10           134.0 ± ∞ ¹    134.0 ± ∞ ¹       ~ (p=1.000 n=5) ²
FakeDB_WriteBlocks/repeated_writes-10            2.728M ± ∞ ¹   2.728M ± ∞ ¹       ~ (p=0.222 n=5)
FakeDB_WriteBlocks/batched_writes-10             2.516M ± ∞ ¹   2.516M ± ∞ ¹       ~ (p=0.690 n=5)
TestDB_FilterEvents/AddressCriteriaFilter-10     20.00M ± ∞ ¹   20.00M ± ∞ ¹       ~ (p=0.722 n=5)
TestDB_FilterEvents/TopicCriteriaFilter-10       20.16M ± ∞ ¹   20.16M ± ∞ ¹       ~ (p=0.325 n=5)
TestDB_FilterEvents/EventLimit-10                21.73M ± ∞ ¹   21.73M ± ∞ ¹  +0.00% (p=0.040 n=5)
TestDB_FilterEvents/EventLimitDesc-10            20.04M ± ∞ ¹   20.04M ± ∞ ¹  +0.00% (p=0.024 n=5)
TestDB_FilterEvents/EventRange-10                10.65M ± ∞ ¹   10.65M ± ∞ ¹  +0.00% (p=0.048 n=5)
TestDB_FilterEvents/EventRangeDesc-10            10.65M ± ∞ ¹   10.65M ± ∞ ¹       ~ (p=0.278 n=5)
TestDB_FilterTransfers/TransferCriteria-10       1.424k ± ∞ ¹   1.424k ± ∞ ¹       ~ (p=1.000 n=5) ²
TestDB_FilterTransfers/TransferCriteriaDesc-10   1.424k ± ∞ ¹   1.424k ± ∞ ¹       ~ (p=1.000 n=5) ²
TestDB_FilterTransfers/Ranged500K-10             2.607M ± ∞ ¹   2.607M ± ∞ ¹  +0.00% (p=0.040 n=5)
TestDB_FilterTransfers/Ranged500KDesc-10         2.607M ± ∞ ¹   2.607M ± ∞ ¹       ~ (p=0.079 n=5)
geomean                                          899.5k         899.5k        -0.00%
¹ need >= 6 samples for confidence interval at level 0.95
² all samples are equal

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • New and existing E2E tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have not added any vulnerable dependencies to my code

@libotony libotony requested a review from a team as a code owner January 9, 2026 11:33
@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 39.58333% with 29 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
logdb/logdb.go 36.95% 27 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

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.

4 participants