Closed Bug 1020494 Opened 11 years ago Closed 11 years ago

10% slower AOT compilation speed on sqlite

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: azakai, Unassigned)

Details

See https://wiki.mozilla.org/Platform/Games/Testing/32v64bit One result from there is that 64-bit windows builds compile sqlite (sqlite-cold-preparation) 10% or so slower than 32-bit builds on the same machine, which is a little surprising, so perhaps worth profiling.
sunfish had the very plausible suggestion that on 64-bit, we have many more registers, and on sqlite regalloc is a hard problem - so the two builds are solving different problems. E.g. perhaps 32-bit just keeps spilling all the time, while 64-bit can do better but needs to work more. Profiling that shows the time difference is all in regalloc would support that theory.
I profiled this a bit: Parse time: ~20ms *faster* on x64 Validate and generate MIR: ~120ms slower on x64 Optimize MIR: ~100ms slower on x64 Generate LIR and regalloc: ~100ms *faster* on x64 Overall compile time on x64 is ~800ms. So my theory on the two cases where we're slower is the same as it was earlier: I think the slowdown is from touching 2x more data; parse, MIR and LIR nodes are all primarily pointers. Validation and MIR-generation in particular touches both the AST and entire MIR graph at the same time. I'm guessing regalloc is faster since more registers means less pressure so less work. To test this I ran cachegrind on compilation and this shows: x64 x86 I refs 6.2B 6.7B D refs 2.8B 3.8B LL refs 136M 98M LL misses 20M 11M (LL = Last-level cache) So this shows x64 executing less instructions and memory accesses, but falling back on the last-level cache a lot more and missing that a lot more. This would seem to support my hypothesis, although it'd take more fine-grained testing to be sure. Overall, I'm thinking of resolving wontfix, but I'd be happy to hear other opinions.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.