{"id":152,"date":"2011-06-11T17:57:44","date_gmt":"2011-06-11T15:57:44","guid":{"rendered":"http:\/\/www.crydust.be\/blog\/?p=152"},"modified":"2011-06-11T17:57:44","modified_gmt":"2011-06-11T15:57:44","slug":"optimizing-javascript","status":"publish","type":"post","link":"https:\/\/www.crydust.be\/blog\/2011\/06\/11\/optimizing-javascript\/","title":{"rendered":"Optimizing JavaScript is harder than ever"},"content":{"rendered":"<p>We&#8217;ve all got our favorite browser. And while developing for the web we test in that one browser first. Optimizing JavaScript for one browser only is a tempting idea. I mean &#8230; how much difference could there be between browser engines anyway?<\/p>\n<p><a href=\"http:\/\/www.crydust.be\/blog\/wp-content\/uploads\/jsperf_fibonacci.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.crydust.be\/blog\/wp-content\/uploads\/jsperf_fibonacci-150x150.png\" alt=\"\" title=\"jsperf_fibonacci\" width=\"150\" height=\"150\" class=\"alignright size-thumbnail wp-image-153\" \/><\/a> Let&#8217;s use the Fibonacci sequence as an example. I wrote <a href=\"http:\/\/jsperf.com\/fibonacci4\">six different versions<\/a> to calculate it. Obviously the naive, recursive way of calculating it is the slowest, but that is where similarities between browsers end. Internet explorer seems to be faster at looping than rounding numbers. And Chrome seems to favor local variables over global ones so much it doesn&#8217;t mind doing a lot more calculations.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We&#8217;ve all got our favorite browser. And while developing for the web we test in that one browser first. Optimizing JavaScript for one browser only is a tempting idea. I mean &#8230; how much difference could there be between browser &hellip; <a href=\"https:\/\/www.crydust.be\/blog\/2011\/06\/11\/optimizing-javascript\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[],"class_list":["post-152","post","type-post","status-publish","format-standard","hentry","category-javascript"],"_links":{"self":[{"href":"https:\/\/www.crydust.be\/blog\/wp-json\/wp\/v2\/posts\/152","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.crydust.be\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.crydust.be\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.crydust.be\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.crydust.be\/blog\/wp-json\/wp\/v2\/comments?post=152"}],"version-history":[{"count":3,"href":"https:\/\/www.crydust.be\/blog\/wp-json\/wp\/v2\/posts\/152\/revisions"}],"predecessor-version":[{"id":156,"href":"https:\/\/www.crydust.be\/blog\/wp-json\/wp\/v2\/posts\/152\/revisions\/156"}],"wp:attachment":[{"href":"https:\/\/www.crydust.be\/blog\/wp-json\/wp\/v2\/media?parent=152"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.crydust.be\/blog\/wp-json\/wp\/v2\/categories?post=152"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.crydust.be\/blog\/wp-json\/wp\/v2\/tags?post=152"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}