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

Switch to a custom allocator by default #2607

Closed
LesnyRumcajs opened this issue Feb 27, 2023 · 11 comments · Fixed by #2703
Closed

Switch to a custom allocator by default #2607

LesnyRumcajs opened this issue Feb 27, 2023 · 11 comments · Fixed by #2703
Assignees

Comments

@LesnyRumcajs
Copy link
Member

Issue summary

Once we have the benchmark results comparing mimalloc, jemalloc and the default allocator, we should decide which one to use by default. Most likely, based on the feedback from @elmattic and @hanabi1224 it would be one of the custom ones.

Other information and links

@hanabi1224
Copy link
Contributor

hanabi1224 commented Mar 23, 2023

Here's the snapshot import benchmark result I got on DO droplet

branch allocator db size peak rss time
hm/track-peak-rss default 100GB 12.02GB 4485s
hm/track-peak-rss mimalloc 100GB 10GB 4909s
hm/track-peak-rss jemalloc 100GB 8.92GB 3873s

Block validation metrics on mainnet

branch allocator total time total blocks avg
main default 5384.7s 271 19.87s
main mimalloc 8174.3s 435 18.8s
main jemalloc 7042.6s 371 18.98s

@hanabi1224
Copy link
Contributor

So let's ship jemalloc? @elmattic @LesnyRumcajs @lemmih

@lemmih
Copy link
Contributor

lemmih commented Mar 23, 2023

Sounds good to me.

@LesnyRumcajs
Copy link
Member Author

Yeah, sounds reasonable.

@elmattic
Copy link
Contributor

@hanabi1224 what about validation time?

@hanabi1224
Copy link
Contributor

@elmattic I did not run validation but I think the bottleneck of validation is not database but fvm

@elmattic
Copy link
Contributor

Agree, but memory allocator should have an impact on the fvm, so validation time too, no?

@hanabi1224
Copy link
Contributor

@elmattic OK, I can collect BLOCK_VALIDATION_TIME metrics with different allocators

@elmattic
Copy link
Contributor

I will run the ruby benchmark script on my side on a Fedora 37.

@hanabi1224
Copy link
Contributor

hanabi1224 commented Mar 23, 2023

I will run the ruby benchmark script on my side on a Fedora 37.

@elmattic Sounds good, thx! At the same time, I will run forest with different allocators and fetch metrics with the below command

wget -O - http://localhost:6116/metrics | grep apply_blocks_time_ | tail -n 2

# output
apply_blocks_time_sum 163.53027957700002
apply_blocks_time_count 6

@hanabi1224
Copy link
Contributor

@elmattic block validation metrics updated, no obvious gain or loss is observed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

4 participants