Permalink
Browse files

Switch profiler to stackprof (Ruby 2.1+)

  • Loading branch information...
1 parent 20e7f15 commit 6bedeecc3b4ce139c5b74c39aecce5bff29de578 Michael Klishin committed Nov 24, 2013
Showing with 5 additions and 4 deletions.
  1. +5 −4 profiling/pure/body_framing_with_2k_payload.rb
@@ -17,16 +17,17 @@
puts "Doing a warmup run..."
15_000.times { AMQ::Protocol::Method.encode_body("ab" * 1024, 1, FRAME_SIZE) }
-require 'ruby-prof'
+require 'stackprof'
# preallocate
ary = Array.new(n) { "ab" * 1024 }
puts "Doing main run..."
-result = RubyProf.profile do
+result = StackProf.run(mode: :wall) do
n.times { |i| AMQ::Protocol::Method.encode_body(ary[i], 1, FRAME_SIZE) }
end
-printer = RubyProf::FlatPrinter.new(result)
-printer.print(STDOUT, {})
+File.open('./profiling/dumps/body_framing_with_2k_payload.dump', "w+") do |f|
+ f.write Marshal.dump(result)
+end

0 comments on commit 6bedeec

Please sign in to comment.