Skip to content

Commit

Permalink
Add stackprof profiling tool
Browse files Browse the repository at this point in the history
Entirely inconclusive, nearly all time is spent reading from hiredis for
'read-multi' operations.
  • Loading branch information
sorentwo committed Aug 11, 2015
1 parent a110ebb commit b5d7e93
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ group :benchmarking do
gem 'oj'
gem 'msgpack'
gem 'redis-activesupport'
gem 'stackprof'
end
20 changes: 20 additions & 0 deletions benchmarks/profile.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
require 'bundler'

Bundler.setup

require 'fileutils'
require 'stackprof'
require 'readthis'

readthis = Readthis::Cache.new('redis://localhost:6379/11')

FileUtils.mkdir_p('tmp')
readthis.clear

('a'..'z').each { |key| readthis.write(key, key * 1024) }

StackProf.run(mode: :object, interval: 500, out: "tmp/stackprof-object.dump") do
1000.times do
readthis.read_multi(*('a'..'z'))
end
end

0 comments on commit b5d7e93

Please sign in to comment.