Created
December 3, 2014 10:51
-
-
Save kares/b145d677c1faac646979 to your computer and use it in GitHub Desktop.
JRuby 1.7.16 benchmark for java.lang.System.getProperty
This file contains hidden or 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 'benchmark' | |
| TIMES = 10_000 | |
| Benchmark.bmbm do |x| | |
| x.report("java.lang.System.get_property [#{TIMES}x]") do | |
| TIMES.times do | |
| java.lang.System.get_property('jars.skip') == 'true' | |
| end | |
| end | |
| x.report("ENV_JAVA [#{TIMES}x]") do | |
| TIMES.times do | |
| ENV_JAVA['jars.skip'] == 'true' | |
| end | |
| end | |
| end |
This file contains hidden or 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
| Rehearsal -------------------------------------------------------------------------- | |
| java.lang.System.get_property [10000x] 0.130000 0.010000 0.140000 ( 0.063000) | |
| ENV_JAVA [10000x] 0.020000 0.000000 0.020000 ( 0.014000) | |
| ----------------------------------------------------------------- total: 0.160000sec | |
| user system total real | |
| java.lang.System.get_property [10000x] 0.030000 0.000000 0.030000 ( 0.025000) | |
| ENV_JAVA [10000x] 0.010000 0.000000 0.010000 ( 0.010000) |
This file contains hidden or 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
| Rehearsal -------------------------------------------------------------------------- | |
| java.lang.System.get_property [10000x] 0.150000 0.000000 0.150000 ( 0.069000) | |
| ENV_JAVA [10000x] 0.020000 0.000000 0.020000 ( 0.012000) | |
| ----------------------------------------------------------------- total: 0.170000sec | |
| user system total real | |
| java.lang.System.get_property [10000x] 0.030000 0.000000 0.030000 ( 0.019000) | |
| ENV_JAVA [10000x] 0.000000 0.000000 0.000000 ( 0.007000) |
This file contains hidden or 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
| Rehearsal -------------------------------------------------------------------------- | |
| ENV_JAVA [10000x] 0.110000 0.010000 0.120000 ( 0.047000) | |
| java.lang.System.get_property [10000x] 0.060000 0.000000 0.060000 ( 0.035000) | |
| ----------------------------------------------------------------- total: 0.180000sec | |
| user system total real | |
| ENV_JAVA [10000x] 0.010000 0.000000 0.010000 ( 0.007000) | |
| java.lang.System.get_property [10000x] 0.020000 0.000000 0.020000 ( 0.025000) |
This file contains hidden or 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
| Rehearsal -------------------------------------------------------------------------- | |
| ENV_JAVA [10000x] 0.110000 0.000000 0.110000 ( 0.049000) | |
| java.lang.System.get_property [10000x] 0.070000 0.010000 0.080000 ( 0.039000) | |
| ----------------------------------------------------------------- total: 0.190000sec | |
| user system total real | |
| ENV_JAVA [10000x] 0.010000 0.000000 0.010000 ( 0.007000) | |
| java.lang.System.get_property [10000x] 0.020000 0.000000 0.020000 ( 0.017000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment