Skip to content

Commit

Permalink
Updated benchmark scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
gettalong committed Mar 13, 2022
1 parent 7f946ce commit bde0a90
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion benchmark/benchmark-rubies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ eval $(grep -e '^TMPDIR' benchmark/benchmark.sh)
cd $TMPDIR

for I in kramdown-ruby*.dat; do
echo $I | sed -E 's/.*(ruby-.*p[0-9]+(-jit)?).*/\1 ||/' > $I.ruby
echo $I | sed -E 's/.*(ruby-.*p[0-9]+(-[my]jit)?).*/\1 ||/' > $I.ruby
awk '{ print $2 }' $I | tail -n +2 >> $I.ruby
done
paste <(awk '{ print $1 }' $(ls kramdown-ruby*.dat | head -n 1)) *.ruby > kramdown-rubies.dat
Expand Down
9 changes: 6 additions & 3 deletions benchmark/benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,12 @@ git clone .git ${TMPDIR}/kramdown
cd ${TMPDIR}/kramdown

for RUBY_VERSION in $RUBY_VERSIONS; do
if [[ ${RUBY_VERSION: -1} = j ]]; then
rbenv shell ${RUBY_VERSION%j}
export RUBYOPT=--jit
if [[ ${RUBY_VERSION: -1} = m ]]; then
rbenv shell ${RUBY_VERSION%m}
export RUBYOPT=--mjit
elif [[ ${RUBY_VERSION: -1} = y ]]; then
rbenv shell ${RUBY_VERSION%y}
export RUBYOPT=--yjit
else
rbenv shell $RUBY_VERSION
unset RUBYOPT
Expand Down
3 changes: 2 additions & 1 deletion benchmark/generate_data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@

THISRUBY = (self.class.const_defined?(:RUBY_DESCRIPTION) ? RUBY_DESCRIPTION.scan(/^.*?(?=\s*\(|,)/).first.sub(/\s/, '-') : "ruby-#{RUBY_VERSION}")
THISRUBY << '-' + RUBY_PATCHLEVEL.to_s unless THISRUBY =~ /p#{RUBY_PATCHLEVEL}$/
THISRUBY << '-jit' if RUBY_DESCRIPTION =~ /JIT/
THISRUBY << '-mjit' if RUBY_DESCRIPTION =~ /MJIT/
THISRUBY << '-yjit' if RUBY_DESCRIPTION =~ /YJIT/

Dir.chdir(File.dirname(__FILE__))
BMDATA = File.read('mdbasics.text')
Expand Down

0 comments on commit bde0a90

Please sign in to comment.