Created
July 29, 2010 19:31
-
-
Save nrk/498997 to your computer and use it in GitHub Desktop.
JSON under IronRuby (and comparisons)
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
C:\IronRuby\v1.1.0>ir json_speed.rb pure | |
Rehearsal ------------------------------------ | |
474.906250 39.421875 514.328125 (394.262696) | |
------------------------- total: 514.328125sec | |
user system total real | |
482.531250 43.140625 525.671875 (384.509766) | |
C:\IronRuby\v1.1.0>ir json_speed.rb ext | |
Rehearsal ------------------------------------ | |
0.140625 0.000000 0.140625 ( 0.145508) | |
--------------------------- total: 0.140625sec | |
user system total real | |
0.062500 0.000000 0.062500 ( 0.071289) |
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
C:\IronRuby\v1.1.0>jruby json_speed.rb pure | |
Rehearsal ------------------------------------ | |
1.649000 0.000000 1.649000 ( 1.649000) | |
--------------------------- total: 1.649000sec | |
user system total real | |
0.673000 0.000000 0.673000 ( 0.673000) | |
C:\IronRuby\v1.1.0>jruby json_speed.rb ext | |
Rehearsal ------------------------------------ | |
0.303000 0.000000 0.303000 ( 0.302000) | |
--------------------------- total: 0.303000sec | |
user system total real | |
0.096000 0.000000 0.096000 ( 0.096000) |
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
require 'open-uri' | |
require 'benchmark' | |
variant = ARGV[0] || 'ext' | |
require "json/#{variant}" | |
data = open('510kbyte.json').read | |
Benchmark.bmbm do |x| | |
x.report do | |
JSON.parse(data) | |
end | |
end |
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
C:\IronRuby\v1.1.0>ruby json_speed.rb pure | |
Rehearsal ------------------------------------ | |
0.625000 0.000000 0.625000 ( 0.624000) | |
--------------------------- total: 0.625000sec | |
user system total real | |
0.610000 0.000000 0.610000 ( 0.615000) | |
C:\IronRuby\v1.1.0>ruby json_speed.rb ext | |
Rehearsal ------------------------------------ | |
0.047000 0.000000 0.047000 ( 0.036000) | |
--------------------------- total: 0.047000sec | |
user system total real | |
0.031000 0.000000 0.031000 ( 0.023000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I wonder why json/pure performs that bad under IronRuby, even after the first run (which is even more surprising since it's actually slower in the second run). I can't really figure where's the bottleneck...