Skip to content
This repository has been archived by the owner on Oct 11, 2023. It is now read-only.

Commit

Permalink
Updated stub.rb to debug problem with benchmarking in Rubinius.
Browse files Browse the repository at this point in the history
  • Loading branch information
nning committed Feb 12, 2015
1 parent 7e7a942 commit 4b99f6d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions experiments/concurrency/stub.rb
Expand Up @@ -10,13 +10,12 @@ def initialize(mode, socket, cache)
@socket = socket
@cache = cache
@app = Rack::HelloWorld.new
@block = true
@observe = true
@options = David::AppConfig.new
end

def run
loop do
if defined?(JRuby) || @mode == :prefork || @mode == :threaded
if defined?(JRuby) || defined?(Rubinius) || @mode == :prefork || @mode == :threaded
data, sender = @socket.recvfrom(1152)
port, _, host = sender[1..3]
else
Expand Down Expand Up @@ -73,15 +72,16 @@ def run
socket.bind('::', 5683)
4.times { fork { Listener.new(:prefork, socket, cache).run } }
when 'threaded'
# ~16000
# ~17500
socket = UDPSocket.new(Socket::AF_INET6)
socket.bind('::', 5683)
Listener.send(:include, Celluloid)
Listener.pool(size: 8, args: [:threaded, socket, cache]).run
else
# ~14000
# ~17000
socket = Celluloid::IO::UDPSocket.new(Socket::AF_INET6)
socket.bind('::', 5683)
Listener.send(:include, Celluloid::IO)
Listener.new(:sped, socket, cache).run
end

Expand Down

0 comments on commit 4b99f6d

Please sign in to comment.