Closed Bug 631740 Opened 13 years ago Closed 13 years ago

Investigate using the interpreter to avoid JM compilation overhead

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 631951

People

(Reporter: cdleary, Assigned: cdleary)

Details

Attachments

(2 files)

The idea that the team has is to cull out part of the call graph that are not invoked enough times or run for long enough to warrant the compilation speed/space overhead. I wrote a patch to transition from the interpreter to method-JIT-compilation. ( http://hg.mozilla.org/users/cleary_mozilla.com/tm-interp-mq/ )

It's parameterized, per JSScript, on two values: the number of taken back-edges observed for that script and the number of JSOP_CALL-based invocations of that script.  N.B. Method JIT call inline caches continue to try to compile callees as they were.

Bill and I investigated on SunSpider performance today and found the farthest we could push these knobs without really regressing our sunspider score was to (4096 calls before compilation, 512 back edges before compilation).

I just built a browser that tracks total (accumulated) mjit allocation space, including IC stub generation, until the destruction of the runtime, and we're going to be experimenting with speed/space comparisons there.
A value of -1 indicates that a method will never be compiled for this reason, whereas a value of 0 indicates that a method will be compiled the very first time this reason is encountered.
(In reply to comment #0)
> 
> Bill and I investigated on SunSpider performance today and found the farthest
> we could push these knobs without really regressing our sunspider score was to
> (4096 calls before compilation, 512 back edges before compilation).

4096/512 is *much* more aggressive (in terms of avoiding compilation) than I was anticipating would be needed to get good space reduction, and dmandelin's figures in bug 631581 agree, IIUC.  Great news!
(In reply to comment #3)

Thanks for that background info too -- I had missed that comment earlier.

Just to emphasize: we picked the "fringe" numbers and we don't know how benchmark-specific (4096, 512) are to SunSpider.
(In reply to comment #4)
> 
> Just to emphasize: we picked the "fringe" numbers and we don't know how
> benchmark-specific (4096, 512) are to SunSpider.

Sure.  I had been thinking 10 would be a good starting point for measurements :)
(In reply to comment #0)
> The idea that the team has is to cull out part of the call graph that are not
> invoked enough times or run for long enough to warrant the compilation
> speed/space overhead. I wrote a patch to transition from the interpreter to
> method-JIT-compilation. (
> http://hg.mozilla.org/users/cleary_mozilla.com/tm-interp-mq/ )

Just to clarify:  dmandelin proposed two possible don't-compile-everything approaches in bug 631706 and bug 631714, with the latter being more aggressive.  I think your measurements correspond to the latter -- is that right?
Please don't tune for the stupid benchmarks only. Of course, you have to avoid regressing them. Life in the big city.

/be
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: