Skip to content

Instantly share code, notes, and snippets.

@SpringMT
Last active January 1, 2016 00:49
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 SpringMT/8068598 to your computer and use it in GitHub Desktop.
Save SpringMT/8068598 to your computer and use it in GitHub Desktop.
use profile
% ruby -r profile array_push_vs_arrows.rb
user system total real
push 20.140000 2.820000 22.960000 ( 23.494785)
<< 20.450000 2.820000 23.270000 ( 23.862400)
% cumulative self self total
time seconds seconds calls ms/call ms/call name
48.16 19.55 19.55 2000003 0.01 0.05 nil#
41.32 36.32 16.77 2 8385.00 20295.00 Integer#times
5.57 38.58 2.26 1000002 0.00 0.00 Array#<<
4.95 40.59 2.01 1000000 0.00 0.00 Array#push
0.00 40.59 0.00 2 0.00 0.00 Numeric#quo
0.00 40.59 0.00 3 0.00 0.00 Mutex#unlock
0.00 40.59 0.00 3 0.00 0.00 MonitorMixin#mon_exit
0.00 40.59 0.00 4 0.00 0.00 IO#set_encoding
0.00 40.59 0.00 1 0.00 0.00 Kernel#respond_to_missing?
0.00 40.59 0.00 1 0.00 0.00 Kernel#respond_to?
0.00 40.59 0.00 1 0.00 0.00 Gem.suffixes
0.00 40.59 0.00 4 0.00 0.00 Gem.find_unresolved_default_spec
0.00 40.59 0.00 1 0.00 0.00 Array#each
0.00 40.59 0.00 1 0.00 0.00 Gem::Specification.unresolved_deps
0.00 40.59 0.00 32 0.00 0.00 Module#method_added
0.00 40.59 0.00 5 0.00 0.00 BasicObject#singleton_method_added
0.00 40.59 0.00 1 0.00 0.00 Module#module_function
0.00 40.59 0.00 3 0.00 0.00 Class#inherited
0.00 40.59 0.00 10 0.00 0.00 Module#attr_reader
0.00 40.59 0.00 1 0.00 0.00 Module#protected
0.00 40.59 0.00 1 0.00 0.00 String#==
0.00 40.59 0.00 1 0.00 0.00 Kernel#gem_original_require
0.00 40.59 0.00 1 0.00 0.00 Kernel#require
0.00 40.59 0.00 1 0.00 0.00 IO#sync
0.00 40.59 0.00 2 0.00 0.00 IO#sync=
0.00 40.59 0.00 5 0.00 0.00 Fixnum#+
0.00 40.59 0.00 1 0.00 0.00 String#empty?
0.00 40.59 0.00 1 0.00 0.00 String#*
0.00 40.59 0.00 1 0.00 0.00 String#+
0.00 40.59 0.00 5 0.00 0.00 IO#write
0.00 40.59 0.00 5 0.00 0.00 Kernel#print
0.00 40.59 0.00 1 0.00 0.00 Benchmark::Report#initialize
0.00 40.59 0.00 3 0.00 0.00 Class#new
0.00 40.59 0.00 4 0.00 0.00 String#to_s
0.00 40.59 0.00 2 0.00 0.00 String#ljust
0.00 40.59 0.00 4 0.00 0.00 Struct#initialize
0.00 40.59 0.00 4 0.00 0.00 Process.times
0.00 40.59 0.00 4 0.00 0.00 Time#initialize
0.00 40.59 0.00 4 0.00 0.00 Time.now
0.00 40.59 0.00 1 0.00 0.00 TracePoint#enable
0.00 40.59 0.00 3 0.00 0.00 MonitorMixin#mon_enter
0.00 40.59 0.00 3 0.00 0.00 Mutex#lock
0.00 40.59 0.00 4 0.00 0.00 Process::Tms#utime
0.00 40.59 0.00 8 0.00 0.00 Float#-
0.00 40.59 0.00 4 0.00 0.00 Process::Tms#stime
0.00 40.59 0.00 4 0.00 0.00 Process::Tms#cutime
0.00 40.59 0.00 4 0.00 0.00 Process::Tms#cstime
0.00 40.59 0.00 2 0.00 0.00 Fixnum#-
0.00 40.59 0.00 2 0.00 0.00 Fixnum#fdiv
0.00 40.59 0.00 3 0.00 0.00 MonitorMixin#mon_check_owner
0.00 40.59 0.00 2 0.00 0.00 Time#-
0.00 40.59 0.00 6 0.00 0.00 Float#+
0.00 40.59 0.00 2 0.00 0.00 Benchmark::Tms#initialize
0.00 40.59 0.00 2 0.00 20295.00 Benchmark#measure
0.00 40.59 0.00 9 0.00 0.00 Thread.current
0.00 40.59 0.00 2 0.00 0.00 String#initialize_copy
0.00 40.59 0.00 2 0.00 0.00 Kernel#initialize_dup
0.00 40.59 0.00 2 0.00 0.00 Kernel#dup
0.00 40.59 0.00 14 0.00 0.00 String#gsub!
0.00 40.59 0.00 10 0.00 0.00 String#%
0.00 40.59 0.00 10 0.00 0.00 Benchmark::Tms#format
0.00 40.59 0.00 2 0.00 20295.00 Benchmark::Report#item
0.00 40.59 0.00 1 0.00 0.00 Module#===
0.00 40.59 0.00 1 0.00 0.00 Kernel#nil?
0.00 40.59 0.00 1 0.00 40590.00 Benchmark#benchmark
0.00 40.59 0.00 1 0.00 40590.00 Benchmark#bm
0.00 40.59 0.00 1 0.00 0.00 TracePoint#disable
0.00 40.59 0.00 1 0.00 40590.00 #toplevel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment