Add rbtrace and stackprof and a script/benchmark script.

This commit is contained in:
Parker Moore 2014-10-12 02:02:42 -07:00
parent cae5958362
commit c2caaeaf11
2 changed files with 18 additions and 0 deletions

View File

@ -1,2 +1,7 @@
source 'https://rubygems.org'
gemspec
if ENV['BENCHMARK']
gem 'rbtrace'
gem 'stackprof'
end

13
script/benchmark Executable file
View File

@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -e
export BENCHMARK=true
script/bootstrap
TEST_SCRIPT="Jekyll::Commands::Build.process({'source' => 'site'})"
PROF_OUTPUT_FILE=tmp/stackprof-$(date +%Y%m%d).dump
bundle exec ruby -r./lib/jekyll -rstackprof -e "StackProf.run(mode: :cpu, out: '${PROF_OUTPUT_FILE}') { ${TEST_SCRIPT} }"
bundle exec stackprof $PROF_OUTPUT_FILE $@