{"id":587,"date":"2011-03-24T17:23:41","date_gmt":"2011-03-24T06:23:41","guid":{"rendered":"http:\/\/blog.mozilla.org\/nnethercote\/?p=587"},"modified":"2011-03-24T17:23:41","modified_gmt":"2011-03-24T06:23:41","slug":"the-javascript-interpreter-isnt-dead-yet","status":"publish","type":"post","link":"https:\/\/blog.mozilla.org\/nnethercote\/2011\/03\/24\/the-javascript-interpreter-isnt-dead-yet\/","title":{"rendered":"The JavaScript interpreter isn&#8217;t dead yet"},"content":{"rendered":"<p>During most of the development of JaegerMonkey, the JavaScript engine was configured so that JaegerMonkey compiled all executed JavaScript code.\u00a0 Which meant that the old JavaScript interpreter was unused (with the exception that it&#8217;s still used during the recording phase during trace compilation).<\/p>\n<p>However, we eventually discovered that lots of JavaScript functions are only run a small number of times.\u00a0 Compiling such functions is a bad idea &#8212; compilation is slow, and the generated code can be quite large.\u00a0 <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=631951\">Bug 631951<\/a> changed things so that a function is only compiled once it has run 16 times, or any loop within it has run 16 times.<\/p>\n<p>This didn&#8217;t end up making much speed difference, but it reduced the amount of code generated by JaegerMonkey by a lot;\u00a0 I saw numbers ranging from 2.5x to 6.5x on different workloads.\u00a0 For <a href=\"http:\/\/techcrunch.com\">techcrunch.com<\/a>, which is JS-intensive, this translates into roughly a 30MB saving on a 64-bit machine.<\/p>\n<p>And the interpreter lives another day.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>During most of the development of JaegerMonkey, the JavaScript engine was configured so that JaegerMonkey compiled all executed JavaScript code.\u00a0 Which meant that the old JavaScript interpreter was unused (with the exception that it&#8217;s still used during the recording phase during trace compilation). However, we eventually discovered that lots of JavaScript functions are only run [&hellip;]<\/p>\n","protected":false},"author":139,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4543,4544],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/posts\/587"}],"collection":[{"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/users\/139"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/comments?post=587"}],"version-history":[{"count":0,"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/posts\/587\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/media?parent=587"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/categories?post=587"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/tags?post=587"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}