Skip to content

Instantly share code, notes, and snippets.

@hugoabonizio
Last active August 16, 2016 00:12
Show Gist options
  • Save hugoabonizio/79cb90645a50dbf6b4d8dd7aed920c84 to your computer and use it in GitHub Desktop.
Save hugoabonizio/79cb90645a50dbf6b4d8dd7aed920c84 to your computer and use it in GitHub Desktop.
require "./bojack/src/bojack/client"
require "benchmark"
client = BoJack::Client.new
N = 100
Benchmark.bm do |x|
x.report "shared" do
N.times do
client.set "bo", "jack"
end
end
x.report "new" do
N.times do
client = BoJack::Client.new
client.set "bo", "jack"
end
end
end
# user system total real
# shared 0.000000 0.030000 0.030000 ( 7.918069)
# new 0.000000 0.010000 0.010000 ( 0.010263)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment