Enable ISeq caching to improve performance#21644
Conversation
|
I think it'd be worth a cycle just double checking what the bootsnap dir looks like after these changes, and if there'll be any issues for pro/console users. I think it should auto-update transparently, but it'd be worth sanity checking things here 👀 Also worth double checking that the folder won't indefinitely grow over time after changes are made in each release etc, as we don't have any logic to clean this up |
Is this what you were expecting? |
|
Let's do a Pro QA run, and an omnibus build run, to verify that we're not shipping this cache folder |
Description
Enable bootsnap's ISeq compile cache (
compile_cache_iseq: true) to improvemsfconsolestartup time.Bootsnap already caches
$LOAD_PATHlookups (added in #17809), but the ISeq compile cache was left disabled. The ISeq cache compiles Ruby source files to bytecode on first load and serves the pre-compiled bytecode on subsequent boots, avoiding repeated parsing and compilation of ~500+ Ruby files during startup.This was originally disabled with the comment "breaks coverage reporting" — but we don't do this in CI anymore, if we want to do it in the future it makes more sense to figure out how we should deal with this issue then rather than guess at the best way now when we aren't doing coverage
Verification Steps
rm -rf ~/.msf4/bootsnap_cachemsfconsole— first boot builds the cache (may be slightly slower)msfconsoleagain — second boot should be noticeably fasterhyperfine --warmup 3 "bundle exec ruby ./msfconsole -q -x 'exit'"should be improved from masterTest Evidence
Environment
AI Usage Disclosure
Kiro
Pre-Submission Checklist