Skip to content

Instantly share code, notes, and snippets.

@hanachin
Created May 24, 2019 14:22
Show Gist options
  • Save hanachin/3cade5381108c2f50f5a1eb9ad872951 to your computer and use it in GitHub Desktop.
Save hanachin/3cade5381108c2f50f5a1eb9ad872951 to your computer and use it in GitHub Desktop.
diff --git a/exe/rubocop b/exe/rubocop
index abf88369e..9491ded7f 100755
--- a/exe/rubocop
+++ b/exe/rubocop
@@ -3,6 +3,9 @@
$LOAD_PATH.unshift("#{__dir__}/../lib")
+require 'bootsnap'
+Bootsnap.setup(cache_dir: '/tmp/rubocop/', load_path_cache: false, autoload_paths_cache: false)
+
require 'rubocop'
require 'benchmark'
diff --git a/rubocop.gemspec b/rubocop.gemspec
index 96096e6d0..431d4c800 100644
--- a/rubocop.gemspec
+++ b/rubocop.gemspec
@@ -33,6 +33,7 @@ Gem::Specification.new do |s|
'bug_tracker_uri' => 'https://github.com/rubocop-hq/rubocop/issues'
}
+ s.add_runtime_dependency('bootsnap')
s.add_runtime_dependency('jaro_winkler', '~> 1.5.1')
s.add_runtime_dependency('parallel', '~> 1.10')
s.add_runtime_dependency('parser', '>= 2.6')
@hanachin
Copy link
Author

In my environment

after

    _╰╰,   /バショ % ~/src/github.com/rubocop-hq/rubocop
  _/o ŏァ  / ブランチ% master● ヤバイ
∈ミ;ノ,ノ   \メイレイ% time bundle exec rubocop -v
0.70.0
bundle exec rubocop -v  0.52s user 0.08s system 95% cpu 0.634 total
    _╰╰,   /バショ % ~/src/github.com/rubocop-hq/rubocop
  _/o ŏァ  / ブランチ% master● ヤバイ
∈ミ;ノ,ノ   \メイレイ% time bundle exec rubocop -v
0.70.0
bundle exec rubocop -v  0.55s user 0.10s system 93% cpu 0.689 total
    _╰╰,   /バショ % ~/src/github.com/rubocop-hq/rubocop
  _/o ŏァ  / ブランチ% master● ヤバイ
∈ミ;ノ,ノ   \メイレイ% time bundle exec rubocop -v
0.70.0
bundle exec rubocop -v  0.58s user 0.08s system 93% cpu 0

before

    _╰╰,   /バショ % ~/src/github.com/rubocop-hq/rubocop
  _/o ŏァ  / ブランチ% master ヤバイ
∈ミ;ノ,ノ   \メイレイ% time bundle exec rubocop -v
0.70.0
bundle exec rubocop -v  0.79s user 0.12s system 95% cpu 0.952 total
    _╰╰,   /バショ % ~/src/github.com/rubocop-hq/rubocop
  _/o ŏァ  / ブランチ% master ヤバイ
∈ミ;ノ,ノ   \メイレイ% time bundle exec rubocop -v
0.70.0
bundle exec rubocop -v  0.75s user 0.06s system 97% cpu 0.832 total
    _╰╰,   /バショ % ~/src/github.com/rubocop-hq/rubocop
  _/o ŏァ  / ブランチ% master ヤバイ
∈ミ;ノ,ノ   \メイレイ% time bundle exec rubocop -v
0.70.0
bundle exec rubocop -v  0.78s user 0.10s system 95% cpu 0.923 tota

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment