Skip to content

Reuse MDBX cursors in static-file segment writers #19059

@yongkangc

Description

@yongkangc

Summary

  • Reuse MDBX cursors in static-file segment writers to avoid per-block cursor setup.
  • Keep walkers alive and reset ranges instead of reinitialising per block.

Motivation

When StaticFileProducer processes large block ranges it opens fresh read cursors for each block in transactions.rs and receipts.rs. Over millions of blocks this compounds into hundreds of thousands of cursor creations, extra allocations, and longer lock contention on MDBX. Reusing the cursor across the loop should cut CPU time and make writes faster for high throughput workloads.

References

Sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-dbRelated to the databaseC-perfA change motivated by improving speed, memory usage or disk footprint

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions