Created
September 29, 2010 16:33
-
-
Save rafaelss/603070 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
console.log("hello world!"); |
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
print "hello world!" |
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
<?php print "hello world!" ?> |
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
print "hello world!" |
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
puts "hello world!" |
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
$ ./run.sh | |
node === | |
hello world! | |
real 0m0.067s | |
user 0m0.042s | |
sys 0m0.020s | |
lua ==== | |
hello world! | |
real 0m0.004s | |
user 0m0.001s | |
sys 0m0.002s | |
php === | |
hello world! | |
real 0m0.059s | |
user 0m0.037s | |
sys 0m0.014s | |
perl === | |
hello world! | |
real 0m0.013s | |
user 0m0.003s | |
sys 0m0.005s | |
ruby === | |
hello world! | |
real 0m0.014s | |
user 0m0.007s | |
sys 0m0.005s |
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 bash | |
echo "node ===" | |
time node hello_world.js | |
echo "" | |
echo "lua ====" | |
time lua hello_world.lua | |
echo "" | |
echo "php ===" | |
time php hello_world.php | |
echo "" | |
echo "perl ===" | |
time perl hello_world.pl | |
echo "" | |
echo "ruby ===" | |
time ruby hello_world.rb | |
echo "" |
maybe so, I dont know. I am just trying to find a script language that run small scripts fast, so bootstrapping may be important.
I just added some more languages and it seems lua is the winner for now.
I like this kind of stuff, just for fun :)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Isn't this an unfair benchmark?
Node probably has much more bootstrapping operations than ruby... server infrastructure X pure interpreter?