Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env ruby
$LOAD_PATH.push File.expand_path("../../lib", __FILE__)
require "celluloid/autostart"
require "digest/sha2"
class Hasher
include Celluloid
def initialize(secret)
Measure Mode: wall_time
Thread ID: 70197101060600
Fiber ID: 70197103015220
Total Time: 51.83754205703735
Sort by: total_time
%total %self total self wait child calls name
--------------------------------------------------------------------------------
100.00% 0.00% 51.838 0.000 0.000 51.837 1 Global#[No method]
51.691 0.000 51.691 0.000 1/1 <Class::IO>#select
This file has been truncated, but you can view the full file.
Measure Mode: wall_time
Thread ID: 70195624296960
Fiber ID: 70195621886140
Total Time: 9.687909841537476
Sort by: total_time
%total %self total self wait child calls name
--------------------------------------------------------------------------------
100.00% 0.00% 9.688 0.000 0.000 9.688 1 Global#[No method]
9.641 0.000 9.641 0.000 1/1 <Class::IO>#select
➜ benchmark git:(master) ✗ rake benchmark
(in /Users/aayushranaut/Developer/celluloid)
Resolving dependencies...
I, [2016-06-09T18:31:47.435902 #17301] INFO -- : Celluloid 0.17.4 is running in BACKPORTED mode. [ http://git.io/vJf3J ]
ERROR: Couldn't complete benchmark: Celluloid::Error: Celluloid is not yet started; use Celluloid.boot
/Users/aayushranaut/Developer/celluloid/lib/celluloid.rb:38:in `actor_system'
/Users/aayushranaut/Developer/celluloid/lib/celluloid.rb:208:in `actor_system'
/Users/aayushranaut/Developer/celluloid/lib/celluloid.rb:214:in `actor_options'
/Users/aayushranaut/Developer/celluloid/lib/celluloid.rb:185:in `new'
/Users/aayushranaut/Developer/celluloid/benchmarks/actor.rb:26:in `<top (required)>'
#!/usr/bin/env ruby
require "rubygems"
require "bundler/setup"
require "celluloid/autostart"
require "benchmark/ips"
class BenchmarkingActor
include Celluloid
@prathmeshranaut
prathmeshranaut / gist:565f78ceacaab9644c738900c3a5a9e0
Created July 4, 2016 15:17
Added Line 7-11 to allow benchmark a specific file only
require "timeout"
desc "Run Celluloid benchmarks"
task :benchmark do
begin
Timeout.timeout(120) do
if ENV['FILE']
glob = File.expand_path("../../benchmarks/#{ENV['FILE']}.rb", __FILE__)
else
glob = File.expand_path("../../benchmarks/*.rb", __FILE__)
#!/usr/bin/env ruby
require 'rubygems'
require 'bundler/setup'
require 'celluloid/autostart'
require 'benchmark'
message = :ohai
#!/usr/bin/env ruby
require 'rubygems'
require 'bundler/setup'
require 'celluloid/autostart'
require 'benchmark'
message = :ohai
#!/usr/bin/env ruby
require 'rubygems'
require 'bundler/setup'
require 'celluloid/autostart'
require 'benchmark'
message = :ohai
#!/usr/bin/env ruby
$LOAD_PATH.push File.expand_path("../../lib", __FILE__)
require "celluloid/autostart"
require "mathn"
#
# Basic spawn example
#