Closed Bug 782579 Opened 12 years ago Closed 12 years ago

strict mode causes a 66% slow down in simplex-noise.js execution

Categories

(Core :: JavaScript Engine, defect)

17 Branch
x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jonas, Unassigned)

References

()

Details

(Keywords: perf, Whiteboard: [js:p2])

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.0 Safari/537.4 Steps to reproduce: Open http://jsperf.com/simplex-noise-strict-vs-lax Run the benchmark. Actual results: In firefox, and only firefox, there is a big discrepancy in the execution speed of the code between "strict mode" and "normal mode". Expected results: Performance should at least be in the same area.
Same here with FF15, MacOS X.
Assignee: nobody → general
Component: Untriaged → JavaScript Engine
Product: Firefox → Core
This is probably at least in part caused by bug 690446. There are some other sources of slowdown for strict code, but not emitting GNAME opcodes is the biggest one. Note that, while the benchmark's setup function contains var declarations for all variables used in the benchmark code itself, those declarations are local to the setup function, so they won't affect the benchmark code. This leads to the latter using global properties.
Status: UNCONFIRMED → NEW
Depends on: 690446
Ever confirmed: true
I created a new revision of the benchmark to address the var issue: http://jsperf.com/simplex-noise-strict-vs-lax/2
A quick look with the JIT Inspector doesn't show any really meaningful differences. That probably doesn't mean anything, though, as with the inspector active, the times become pretty much identical. CCing bhackett as he might know other reasons for this slowdown.
Blocks: 784295
Whiteboard: [js:p2]
I ran the 2nd version and I got 159 x 163. Seems to be fixed.
Tried it in the current nightly 23.0a1 (2013-05-08) and the difference seems to be gone.
Thanks guys, looks like bug 690446 was the only problem here and this bug is fixed now.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.