Created
November 21, 2012 20:56
-
-
Save grantr/4127657 to your computer and use it in GitHub Desktop.
Celluloid::IncidentLogger benchmarks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MRI 1.9.3-p125 | |
==== Ruby standard logger ==== | |
Calculating ------------------------------------- | |
standard 3361 i/100ms | |
------------------------------------------------- | |
standard 35759.4 (±5.5%) i/s - 181494 in 5.090712s | |
==== below level ==== | |
Calculating ------------------------------------- | |
below level 47480 i/100ms | |
------------------------------------------------- | |
below level 1006480.8 (±18.5%) i/s - 4937920 in 5.039044s | |
==== without consumers ==== | |
Calculating ------------------------------------- | |
firehose without consumers | |
1342 i/100ms | |
incidents without consumers | |
1094 i/100ms | |
------------------------------------------------- | |
firehose without consumers | |
38032.8 (±35.8%) i/s - 101992 in 5.010691s | |
incidents without consumers | |
19942.7 (±45.1%) i/s - 52512 in 5.239218s | |
==== with incident reporter ==== | |
Calculating ------------------------------------- | |
firehose with reporter | |
1867 i/100ms | |
incidents with reporter | |
1292 i/100ms | |
------------------------------------------------- | |
firehose with reporter | |
35606.4 (±43.5%) i/s - 85882 in 5.035598s | |
incidents with reporter | |
22408.7 (±29.1%) i/s - 34884 in 5.032479s | |
==== with incident reporter and firehose consumer ==== | |
Calculating ------------------------------------- | |
firehose with reporter/consumer | |
1847 i/100ms | |
incidents with reporter/consumer | |
128 i/100ms | |
------------------------------------------------- | |
firehose with reporter/consumer | |
39534.1 (±30.3%) i/s - 68339 in 16.544277s | |
incidents with reporter/consumer | |
24516.2 (±8.8%) i/s - 53504 in 5.174900s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'bundler/setup' | |
require 'celluloid' | |
require 'benchmark/ips' | |
require 'logger' | |
puts "==== Ruby standard logger ====" | |
standard_logger = ::Logger.new(IO::NULL) | |
Benchmark.ips do |ips| | |
ips.report("standard") { standard_logger.error("average error message") } | |
end | |
standard_logger = nil | |
puts "==== below level ====" | |
logger = Celluloid::IncidentLogger.new | |
Benchmark.ips do |ips| | |
ips.report("below level") { logger.trace("average trace message") } | |
end | |
logger = nil | |
puts "==== without consumers ====" | |
logger = Celluloid::IncidentLogger.new | |
Celluloid::Actor[:default_incident_reporter].terminate | |
Benchmark.ips do |ips| | |
ips.report("firehose without consumers") { logger.debug("average debug message") } | |
ips.report("incidents without consumers") { logger.error("average error message") } | |
end | |
logger = nil | |
puts "==== with incident reporter ====" | |
logger = Celluloid::IncidentLogger.new | |
reporter = Celluloid::IncidentReporter.new(IO::NULL) | |
Benchmark.ips do |ips| | |
ips.report("firehose with reporter") { logger.debug("average debug message") } | |
ips.report("incidents with reporter") { logger.error("average error message") } | |
end | |
logger = nil | |
reporter.terminate | |
puts "==== with incident reporter and firehose consumer ====" | |
logger = Celluloid::IncidentLogger.new | |
reporter = Celluloid::IncidentReporter.new(IO::NULL) | |
consumer = Celluloid::FirehoseConsumer.new(IO::NULL) | |
Benchmark.ips do |ips| | |
ips.report("firehose with reporter/consumer") { logger.debug("average debug message") } | |
ips.report("incidents with reporter/consumer") { logger.error("average error message") } | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment