Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(db): use smallvec for mdbx table names #11291

Merged
merged 1 commit into from
Sep 27, 2024
Merged

Conversation

DaniPopes
Copy link
Member

Database::new is called on every tx.new_cursor, tx.get, tx.put... (a lot). This function allocates a CString for the table name to pass it through FFI to mdbx. Use smallvec to create the CStr on the stack to avoid this allocation.

@shekhirin shekhirin added C-perf A change motivated by improving speed, memory usage or disk footprint A-db Related to the database labels Sep 27, 2024
@DaniPopes DaniPopes enabled auto-merge September 27, 2024 15:05
@DaniPopes DaniPopes added this pull request to the merge queue Sep 27, 2024
@DaniPopes DaniPopes removed this pull request from the merge queue due to a manual request Sep 27, 2024
@DaniPopes DaniPopes enabled auto-merge September 27, 2024 15:08
@DaniPopes DaniPopes added this pull request to the merge queue Sep 27, 2024
Merged via the queue into main with commit 07e94e7 Sep 27, 2024
36 checks passed
@DaniPopes DaniPopes deleted the dani/db-new-cstring branch September 27, 2024 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-db Related to the database C-perf A change motivated by improving speed, memory usage or disk footprint
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants