Skip to content

Instantly share code, notes, and snippets.

@shirosaki
Created December 24, 2011 07:01
Show Gist options
  • Save shirosaki/1516649 to your computer and use it in GitHub Desktop.
Save shirosaki/1516649 to your computer and use it in GitHub Desktop.
Timing chart
#!/usr/bin/env ruby
#
# https://github.com/mattetti/googlecharts
# http://mattetti.github.com/googlecharts/
#
# Install:
# gem install googlecharts
#
# GitHub Flavord Markdown:
# ![chart title](http://chart.apis.google.com/chart?...)
#
require "gchart"
# From TCS Ruby 1.9.3 timing results
data = {
:Vanilla => 8.283,
:Patched => 2.262,
}
max_y = 10
puts Gchart.bar(
:size => '400x240',
:title => 'Rails Startup Time [sec]',
:title_size => 10,
:bar_width_and_spacing => '60,30',
:axis_with_labels => ['x', 'y'],
:axis_labels => [data.keys.join("|")],
:axis_range => [[], [0, max_y]],
:max_value => max_y,
:data => data.values,
# :format => :image_tag,
).gsub(/%([\[\]])/, '\1') # remove unwanted '%'
@shirosaki
Copy link
Author

  • plain vanilla MRI 1.9.3p0 vs tcs-ruby193_require_winio_fenix-20111223.7z
  • Rails 3.2.0.rc1 on Win7 (32bit) Summary Comparison
  • timer ruby script\rails r "p $LOAD_PATH.size, $LOADED_FEATURES.size"

Startup Timing

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