Skip to content

Conversation

@gap-editor
Copy link
Contributor

Summary
This PR optimizes the read_next method in the ETL data collector. Previously, the method performed two separate 8-byte reads to fetch the key and value lengths. This change consolidates them into a single 16-byte read.

Motivation

  • Reduce Syscalls: Halves the number of read calls required just to determine entry sizes, improving performance when iterating over large datasets.
  • Cleanliness: Uses slice indexing and try_into() for standard byte conversion.

Optimize `EtlFile::read_next` by reading the key length and value length (16 bytes total) in a single `read_exact` call instead of two separate calls. This reduces syscall overhead during the iteration phase.
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can keep this as is

@mattsse mattsse closed this Dec 9, 2025
@github-project-automation github-project-automation bot moved this from Backlog to Done in Reth Tracker Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants