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

Use jemalloc as default allocator. #847

Merged
merged 1 commit into from
Jan 23, 2024
Merged

Conversation

nihohit
Copy link
Contributor

@nihohit nihohit commented Jan 22, 2024

This brings a significant perf improvement in Rust & Node. This replaces the allocator only for GLIDE in the Node library, and replaces the allocator for the whole Rust benchmarking application.
jemalloc.xlsx
Python jemalloc results are for code that isn't added here, where I used jemalloc in a similar way to the Node system. Since there wasn't an improvement, that change isn't a part of this PR.

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

This brings a significant perf improvement in Rust & Node.
@nihohit nihohit requested a review from a team as a code owner January 22, 2024 15:04
@ikolomi
Copy link
Collaborator

ikolomi commented Jan 22, 2024

Generally its somewhat of a dirty practice to super-optimize the bench-marking tools instead of making them as simple (or rely on standard components) as possible yet able to utilize capabilities of SUT. I am ok to switch to jmalloc at our side if a. Its stable b. have a tangible benefits.
What are the results when only the node binding is changed to jmalloc?
Why would we try jmalloc for the core/redis-rs as well?

@shachlanAmazon
Copy link
Contributor

What are the results when only the node binding is changed to jmalloc?

Those are the node results in the file. The Rust benchmarks tests only Rust code. The node benchmark (which isn't changed here) is written in TypeScript.

Why would we try jmalloc for the core/redis-rs as well?

This is the change - the core/redis-rs code + the Rust bindings are changed to use jemalloc.

@shachlanAmazon
Copy link
Contributor

on a local run of npm run build:release, this adds 700K to the node binary size - from 4.7MB to 5.4MB.

@shachlanAmazon shachlanAmazon merged commit e637ce2 into valkey-io:main Jan 23, 2024
6 checks passed
Yury-Fridlyand pushed a commit to Bit-Quill/valkey-glide that referenced this pull request Jan 24, 2024
This brings a significant perf improvement in Rust & Node.
@nihohit nihohit deleted the jemalloc branch January 28, 2024 14:24
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