Skip to content

core, ethdb, triedb: add batch close#33708

Merged
MariusVanDerWijden merged 1 commit into
ethereum:masterfrom
rjl493456442:db-batch-close
Mar 4, 2026
Merged

core, ethdb, triedb: add batch close#33708
MariusVanDerWijden merged 1 commit into
ethereum:masterfrom
rjl493456442:db-batch-close

Conversation

@rjl493456442
Copy link
Copy Markdown
Member

@rjl493456442 rjl493456442 commented Jan 29, 2026

Pebble maintains a batch pool to recycle the batch object. Unfortunately batch object must be
explicitly returned via batch.Close function. This PR extends the batch interface by adding
the close function and also invoke batch.Close in some critical code paths.

Memory allocation must be measured before merging this change. What's more, it's an open
question that whether we should apply batch.Close as much as possible in every invocation.

@rjl493456442 rjl493456442 requested a review from gballet as a code owner January 29, 2026 06:25
Copy link
Copy Markdown
Member

@MariusVanDerWijden MariusVanDerWijden left a comment

Choose a reason for hiding this comment

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

sgtm

@MariusVanDerWijden MariusVanDerWijden merged commit dd202d4 into ethereum:master Mar 4, 2026
10 of 11 checks passed
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.

3 participants