{"id":13858519,"url":"https://github.com/byroot/bootscale","last_synced_at":"2025-04-04T10:07:32.953Z","repository":{"id":59151212,"uuid":"41261926","full_name":"byroot/bootscale","owner":"byroot","description":"Speedup applications boot by caching require calls","archived":false,"fork":false,"pushed_at":"2022-02-15T08:17:15.000Z","size":80,"stargazers_count":191,"open_issues_count":2,"forks_count":17,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-28T09:07:04.729Z","etag":null,"topics":["boot","performance","rails","ruby"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/byroot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-23T18:33:37.000Z","updated_at":"2025-02-15T14:38:59.000Z","dependencies_parsed_at":"2022-09-13T11:00:34.499Z","dependency_job_id":null,"html_url":"https://github.com/byroot/bootscale","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byroot%2Fbootscale","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byroot%2Fbootscale/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byroot%2Fbootscale/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byroot%2Fbootscale/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/byroot","download_url":"https://codeload.github.com/byroot/bootscale/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247157275,"owners_count":20893219,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["boot","performance","rails","ruby"],"created_at":"2024-08-05T03:02:12.035Z","updated_at":"2025-04-04T10:07:32.934Z","avatar_url":"https://github.com/byroot.png","language":"Ruby","readme":"# Bootscale\n\n[![Build Status](https://travis-ci.org/byroot/bootscale.svg)](http://travis-ci.org/byroot/bootscale)\n[![Gem Version](https://badge.fury.io/rb/bootscale.png)](http://badge.fury.io/rb/byroot/bootscale)\n\nSpeedup applications boot by caching file locations during require calls.\n\nSpeed gain depends on your number of gems. Under 100 gems you likely won't see the difference,\nbut for bigger applications it can save 1 to 3 seconds of boot time per 100 used gems.\n\n## Installation\n\n```ruby\n# Gemfile\ngem 'bootscale', require: false\n```\n\n### Important\n\nFor correctness cache should be updated everytime `$LOAD_PATH` is modified by calling `Bootscale.regenerate`.\n\nFor Rails apps it means adding an initializer in `config/application.rb`.\n\n```ruby\nmodule MyApp\n  class Application \u003c Rails::Application\n    initializer :regenerate_require_cache, before: :load_environment_config do\n      Bootscale.regenerate\n    end\n  end\nend\n```\n\n### Rails applications\n\nLocate `require 'bundler/setup'` in `config/boot.rb` and add `require 'bootscale/rails'` after it:\n\n```ruby\nrequire 'bundler/setup'\nrequire 'bootscale/rails'\n```\n\n### Other Bundler enabled applications\n\nLocate `require 'bundler/setup'`, and add `require 'bootscale/setup'` after it:\n\n```ruby\nrequire 'bundler/setup'\nrequire 'bootscale/setup'\n```\n\n## Faster cache loading\n\nIn order to gain ~10-30ms of extra load speed, you can use the msgpack gem:\n\n```ruby\n# Gemfile\ngem 'msgpack',   require: false\ngem 'bootscale', require: false\n```\n\n```ruby\n# config/boot.rb (or wherever you have the require of bundler/setup)\nrequire 'bundler/setup'\nrequire 'msgpack'\nrequire 'bootscale/setup' # or require 'bootscale/rails'\n```\n\n## Under the hood\n\nBootscale caches the absolute location of all requirable files on the $LOAD_PATH and\npatches `require` + `autoload` to use these absolute paths, thereby avoiding having to check all load paths for every require.\n\nProblem outlined in this [talk](https://www.youtube.com/watch?v=kwkbrOwLsZY)\n\n## Troubleshooting\n\nIf you're experiencing problems with loading your application, especially after moving files around, try deleting the `tmp/bootscale` folder.\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/byroot/bootscale.\n\nLocal development: your load time will be very slow when using a local copy for development like `gem 'bootscale', path: '~/Code/bootscal'`, use via git instead.\n\nThanks to Aaron Patterson for the idea of converting relative paths to absolute paths.\n","funding_links":[],"categories":["Ruby"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyroot%2Fbootscale","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbyroot%2Fbootscale","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyroot%2Fbootscale/lists"}