Function()

Jason Orendorff jason.orendorff at gmail.com
Mon Sep 8 09:08:29 PDT 2008


On Sat, Sep 6, 2008 at 1:05 AM, Garrett Smith <dhtmlkitchen at gmail.com> wrote:
> The resulting function would be indistinguishable. The performance
> would be potentially faster (no parsing "" to create a Function).
> Firefox is very slow with Function constructor.
>
> var slow = Function();
> var fast = function(){};

Garrett, this post is really baffling.  :)

What makes you think the ES3 specification is to blame for the
slowness you're seeing?  For all I know, our implementation pre-dates
the spec.  ;-)

If it's a problem that "Firefox is very slow", I heartily encourage
you to file a bug at bugzilla.mozilla.org.  Patches are always
welcome.  SpiderMonkey's Function constructor is implemented at:
http://hg.mozilla.org/mozilla-central/file/a5491c33992e/js/src/jsfun.cpp#l1796

-j


More information about the Es-discuss mailing list