Last active
August 29, 2015 13:56
-
-
Save tamouse/8896963 to your computer and use it in GitHub Desktop.
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
ruby 2.0.0p353 (2013-11-22 revision 43784) [x86_64-darwin13.0.0] | |
Python 2.7.5 | |
javac 1.6.0_65 | |
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 | |
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn) | |
Target: x86_64-apple-darwin13.0.0 | |
Thread model: posix |
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
Rehearsal ------------------------------------------------------------------------------------------ | |
ruby /dev/null 0.000000 0.010000 0.330000 ( 0.358619) | |
ruby --disable-gems /dev/null 0.010000 0.010000 0.090000 ( 0.084430) | |
ruby --disable-gems -e 'puts "hello world!"' /dev/null 0.000000 0.000000 0.100000 ( 0.117331) | |
python /dev/null 0.000000 0.010000 0.220000 ( 0.233016) | |
python -s -S /dev/null 0.000000 0.000000 0.090000 ( 0.106474) | |
gcc null.c 0.000000 0.010000 0.290000 ( 0.317702) | |
--------------------------------------------------------------------------------- total: 1.120000sec | |
user system total real | |
ruby /dev/null 0.000000 0.010000 0.360000 ( 0.365761) | |
ruby --disable-gems /dev/null 0.000000 0.000000 0.080000 ( 0.095927) | |
ruby --disable-gems -e 'puts "hello world!"' /dev/null 0.000000 0.010000 0.100000 ( 0.107404) | |
python /dev/null 0.010000 0.000000 0.210000 ( 0.223067) | |
python -s -S /dev/null 0.000000 0.010000 0.100000 ( 0.107324) | |
gcc null.c 0.000000 0.000000 0.300000 ( 0.334820) | |
(For 10 iterations each. null.java is an empty file (0 bytes). null.c contains an empty main (12 bytes).) |
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 'benchmark' | |
require 'fileutils' | |
FileUtils.rm_f "null.java" | |
FileUtils.touch "null.java" | |
FileUtils.rm_f "null.c" | |
File.write("null.c","int main(){}") | |
n = 10 | |
commands = [ | |
"ruby /dev/null", | |
"ruby --disable-gems /dev/null", | |
"ruby --disable-gems -e 'puts \"hello world!\"' /dev/null", | |
"python /dev/null", | |
"python -s -S /dev/null", | |
# "javac null.java", # cos why bovver? | |
"gcc null.c" | |
] | |
Benchmark.bmbm do |b| | |
commands.each do |cmd| | |
b.report(cmd) { n.times { %x{#{cmd}}}} | |
end | |
end | |
puts "(For #{n} iterations each. null.java is an empty file (#{File.size("null.java")} bytes). null.c contains an empty main (#{File.size("null.c")} bytes).)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment