A Ruby library that speeds up application boot time by caching expensive computations like path lookups and code compilation.
Bootsnap is a Ruby gem that optimizes application boot time by caching expensive computations like filesystem path lookups and code compilation. It plugs into Ruby's `require` and `load` mechanisms to eliminate redundant work, reducing boot times by up to 75% for large Rails applications.
Ruby and Rails developers working on large monolithic applications with slow boot times, particularly in development and production environments where rapid restart is valuable.
Developers choose Bootsnap because it provides significant boot time reductions with minimal configuration, works alongside existing tools like Spring, and is production-safe with no application code changes required.
Boot large Ruby/Rails apps faster
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Bootsnap reduces boot times by up to 75% for large apps like Shopify's monolith, as shown in README benchmarks, by caching path lookups and compilation.
It's a drop-in gem that requires only adding 'require bootsnap/setup' to config/boot.rb, with no application code changes needed.
Works safely in development, test, and production environments with configurable cache behavior, as noted in the Environments section.
Provides callbacks to monitor cache hits, misses, and stale entries, helping identify performance bottlenecks during setup.
Bootsnap never cleans up its own cache, requiring manual purging of tmp/cache/bootsnap* to avoid progressive slowdowns, as warned in the README.
Performance degrades on non-local or slow filesystems, and boot failures occur if the cache directory isn't writable, limiting deployment options.
It has known problems in QEMU environments causing hangs, requiring workarounds like disabling parallelization, and limited support for non-MRI Rubies.