Closed Bug 523686 Opened 15 years ago Closed 15 years ago

Kill fun_enumerate

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
minor

Tracking

()

RESOLVED FIXED

People

(Reporter: Waldo, Assigned: Waldo)

Details

(Keywords: perf, Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file)

It existed only to look up .prototype so that it would be enumerated properly, but since the prototype property of functions is now not enumerable (bug 514603), that work is a waste of time.  Here's a micro-benchmark to demonstrate that this provides a perf win (measurable real-world win seems less likely):

[jwalden@the-great-waldo-search opt]$ cat /tmp/time.js 
var start = Date.now();

for (var i = 0; i < 1e6; i++)
{
  var f = function(){};
  for (var p in f);
}

var duration = Date.now() - start;
print("Elapsed: " + duration + "ms");
[jwalden@the-great-waldo-search opt]$ ./js -j -f /tmp/time.js 
/tmp/time.js:6: out of memory
/tmp/time.js:6: out of memory
Elapsed: 1748ms
[jwalden@the-great-waldo-search opt]$ n ../jsfun.cpp 
[jwalden@the-great-waldo-search opt]$ make -s
jsfun.cpp
imacros.c.out is up to date
[jwalden@the-great-waldo-search opt]$ ./js -j -f /tmp/time.js 
/tmp/time.js:6: out of memory
Elapsed: 675ms

(no bug filed yet on the spurious OOM messages, coming after this gets filed)
Attachment #407595 - Flags: review?(jorendorff)
Comment on attachment 407595 [details] [diff] [review]
JS_EnumerateStub ftw

Yay! Sorry for the conflict I just pushed into fun_enumerate; you can just delete it.
Attachment #407595 - Flags: review?(jorendorff) → review+
http://hg.mozilla.org/tracemonkey/rev/240dc0b2b41f
Whiteboard: fixed-in-tracemonkey
http://hg.mozilla.org/mozilla-central/rev/240dc0b2b41f
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: