Revisions
-
ckdake revised this gist
Apr 3, 2011 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -30,6 +30,7 @@ print <<<EOF <html><body>$message</body></html> EOF; } ruby-1.9.2-p0 adella:benchmarks$ time ruby foo.rb >/dev/null real 0m0.090s -
ckdake revised this gist
Apr 3, 2011 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,24 +1,27 @@ ruby-1.9.2-p0 adella:benchmarks$ ruby -v ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.5.0] ruby-1.9.2-p0 adella:benchmarks$ php -v PHP 5.3.3 (cli) (built: Aug 22 2010 19:41:55) Copyright (c) 1997-2010 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies ruby-1.9.2-p0 adella:benchmarks$ cat foo.rb msg = "Hello world" 100000.times do puts <<EOF <html><body>#{msg}</body></html> EOF end ruby-1.9.2-p0 adella:benchmarks$ cat foo.php <?php $message = "Hello world"; for($i=0;$i<100000;$i++) { ?> <html><body><?= message ?></body></html> <?php } ?> ruby-1.9.2-p0 adella:benchmarks$ cat foo-ng.php <?php $message = "Hello world"; -
ckdake created this gist
Apr 3, 2011 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,44 @@ ruby-1.9.2-p0 adella:benchmarks$ ruby -v ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.5.0] ruby-1.9.2-p0 adella:benchmarks$ php -v PHP 5.3.3 (cli) (built: Aug 22 2010 19:41:55) Copyright (c) 1997-2010 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies ruby-1.9.2-p0 adella:benchmarks$ cat foo.rb msg = "Hello world" 100000.times do puts <<EOF <html><body>#{msg}</body></html> EOF end ruby-1.9.2-p0 adella:benchmarks$ cat foo.php <?php $message = "Hello world"; for($i=0;$i<100000;$i++) { ?> <html><body><?= message ?></body></html> <?php } ?> ruby-1.9.2-p0 adella:benchmarks$ cat foo-ng.php <?php $message = "Hello world"; for($i=0;$i<100000;$i++) { print <<<EOF <html><body>$message</body></html> EOF; } ruby-1.9.2-p0 adella:benchmarks$ time ruby foo.rb >/dev/null real 0m0.090s user 0m0.084s sys 0m0.005s ruby-1.9.2-p0 adella:benchmarks$ time php foo.php >/dev/null real 0m0.352s user 0m0.198s sys 0m0.150s ruby-1.9.2-p0 adella:benchmarks$ time php foo-ng.php >/dev/null real 0m0.132s user 0m0.073s sys 0m0.055s