Skip to content

Instantly share code, notes, and snippets.

@andrykonchin
Created July 5, 2020 18:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrykonchin/6c1e7699e16ed1b1ea89cda265c50fe9 to your computer and use it in GitHub Desktop.
Save andrykonchin/6c1e7699e16ed1b1ea89cda265c50fe9 to your computer and use it in GitHub Desktop.
Example of exe/rubocop-profile file to measure performance
#!/usr/bin/env ruby
# frozen_string_literal: true
$LOAD_PATH.unshift("#{__dir__}/../lib")
require 'rubocop'
require 'stackprof'
result = 0
StackProf.run(mode: :cpu, out: 'tmp/stackprof.dump') do
cli = RuboCop::CLI.new
result = cli.run
end
exit result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment