{"id":697,"date":"2009-11-11T17:07:15","date_gmt":"2009-11-11T16:07:15","guid":{"rendered":"http:\/\/www.stenyak.com\/?p=697"},"modified":"2009-11-11T17:07:15","modified_gmt":"2009-11-11T16:07:15","slug":"googles-go-simple-stupid-benchmark","status":"publish","type":"post","link":"https:\/\/www.stenyak.com\/?p=697","title":{"rendered":"Google&#8217;s &#8220;go&#8221; simple &#038; stupid benchmark (1st round: I\/O)"},"content":{"rendered":"<p><a href=\"http:\/\/golang.org\">Systems programming language<\/a>? They gotta be kiddin&#8230;<\/p>\n<pre>$ cat <strong>hello.cpp<\/strong> &amp;&amp; g++ hello.cpp &amp;&amp;\n&gt; time for i in $(seq 100); do .\/a.out &gt;\/dev\/null; done\n\n#include &lt;stdio.h&gt;\nint main (int argc, char** argv)\n{\n    for (int i=10000;i--;)\n    {\n        printf(\"hello, world\\n\");\n    }\n}\n\n<strong>real<\/strong><span><strong> <\/strong><\/span><strong>0m0.427s\nuser<\/strong><span><strong> <\/strong><\/span><strong>0m0.220s\nsys<\/strong><span><strong> <\/strong><\/span><strong>0m0.164s<\/strong><\/pre>\n<hr \/>\n<pre>$ cat <strong>hello.py<\/strong> &amp;&amp;\n&gt; time for i in $(seq 100); do python hello.py &gt;\/dev\/null; done\n\nfor i in range(1,10001):\n    print \"hello, world\"\n\n<strong>real<\/strong><span><strong> <\/strong><\/span><strong>0m3.809s\nuser<\/strong><span><strong> <\/strong><\/span><strong>0m2.800s\nsys<\/strong><span><strong> <\/strong><\/span><strong>0m0.724s<\/strong><\/pre>\n<hr \/>\n<pre>$ cat <strong>hello.go<\/strong> &amp;&amp; 8g hello.go &amp;&amp; 8l hello.8 &amp;&amp;\n&gt; time for i in $(seq 100); do .\/8.out &gt;\/dev\/null; done\n\npackage main\nimport \"fmt\"\nfunc main()\n{\n    for i:=10000;i&gt;0;i--\n    {\n        fmt.Printf(\"hello, world\\n\")\n    }\n}\n\n<strong>real<\/strong><span><strong> <\/strong><\/span><strong>0m7.528s\nuser<\/strong><span><strong> <\/strong><\/span><strong>0m6.388s\nsys<\/strong><span><strong> <\/strong><\/span><strong>0m0.664s<\/strong><\/pre>\n<p>Continued in <a href=\"http:\/\/www.stenyak.com\/archives\/711\/googles-go-simple-stupid-benchmark-2nd-round-memspeed\/\">Round 2: memspeed<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Systems programming language? They gotta be kiddin&#8230; $ cat hello.cpp &amp;&amp; g++ hello.cpp &amp;&amp; &gt; time for i in $(seq 100); do .\/a.out &gt;\/dev\/null; done #include &lt;stdio.h&gt; int main (int argc, char** argv) { for (int i=10000;i&#8211;;) { printf(&#8220;hello, world\\n&#8221;); } } real 0m0.427s user 0m0.220s sys 0m0.164s $ cat hello.py &amp;&amp; &gt; time for [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3,4],"tags":[13,24],"_links":{"self":[{"href":"https:\/\/www.stenyak.com\/index.php?rest_route=\/wp\/v2\/posts\/697"}],"collection":[{"href":"https:\/\/www.stenyak.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.stenyak.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.stenyak.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.stenyak.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=697"}],"version-history":[{"count":0,"href":"https:\/\/www.stenyak.com\/index.php?rest_route=\/wp\/v2\/posts\/697\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.stenyak.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=697"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.stenyak.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=697"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.stenyak.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=697"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}