Closed Bug 602132 Opened 14 years ago Closed 12 years ago

Consider self-hosting Array.forEach

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 784294

People

(Reporter: bzbarsky, Unassigned)

References

Details

Attachments

(1 file)

See the attached code.  Running that with -m shows a slight speedup of the self-hosted version over the native version (modulo bug 602129).  Running with -j shows a significant speedup (order of 50% faster).  That's even with the JM gatling gun patch applied.  The only caveat is I hacked in a "fix" for bug
Attached file quick prototype
Depends on: 462300
Er, the tail end of comment 0 should have been "bug 602131".  Working on a real fix for that now.
With the patches in bug 602131 and the patch from bug 581893 (to make the comparison more fair) applied, I get these times with -j -m on the attached testcase:

  434
  438
  96
  124

If I make the array a slow array (by setting |arr.foo = 0| on it), I get these times:
  1268
  1293
  972
  1011

so even that is decent.

Times with -m only for the self-hosted version are:

Fast arrays: 428
             1286
Slow arrays: 1231
             2250
so even that's a bit of a win over the native, modulo bug 602129.
Depends on: 664769
Depends on: 664824
Blocks: 598771
Depends on: 784288
Depends on: 784294
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → DUPLICATE
No longer depends on: 784294
No longer depends on: 784288
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: