Skip to content

Instantly share code, notes, and snippets.

@Domon
Forked from jfairbairn/gist:900008
Created April 3, 2011 14:00
Show Gist options
  • Save Domon/900433 to your computer and use it in GitHub Desktop.
Save Domon/900433 to your computer and use it in GitHub Desktop.
heffalump:~ james$ ruby -v
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10.7.1]
heffalump:~ james$ php -v
PHP 5.3.4 (cli) (built: Jan 17 2011 21:54:20)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
heffalump:~ james$ cat foo.rb
msg = "Hello world"
100000.times do
puts <<EOF
<html><body>#{msg}</body></html>
EOF
end
heffalump:~ james$ time ruby foo.rb >/dev/null
real 0m0.089s
user 0m0.082s
sys 0m0.003s
heffalump:~ james$ cat foo.php
<?php
$message = "Hello world";
for($i=0;$i<100000;$i++) {
?>
<html><body><?= message ?></body></html>
<?php } ?>
heffalump:~ james$ time php foo.php >/dev/null
real 0m0.272s
user 0m0.144s
sys 0m0.126s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment