Closed Bug 523497 Opened 15 years ago Closed 14 years ago

TM: Cut off traces with too many merges

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: dvander, Unassigned)

References

Details

Attachments

(1 file, 2 obsolete files)

Since bug 516264 is unresolved, we need a way to stop explody traces from getting out of control. This currently happens in 3d-cube when we trace Loop() using recursion (tail calls, see bug 445363 comment #59).

To get an idea of what heuristics we should try, I got some statistics on TraceRecorder::cfgMerges per compile() call. Each line is the script+line where the trace ends, and the interval is the min and max value for cfgMerges.

Before tail calls:
---------------------
3d-cube.js:232 [46, 46]
3d-raytrace.js:295 [1, 11]
date-format-xparb.js:413 [0, 7]
3d-raytrace.js:191 [2, 5]
3d-raytrace.js:252 [3, 3]
access-fannkuch.js:17 [1, 3]
3d-raytrace.js:247 [2, 3]
string-base64.js:92 [1, 3]
crypto-sha1.js:61 [1, 2]
3d-raytrace.js:225 [1, 2]

After tail calls:
---------------------
3d-cube.js:232 [19, 46]
3d-raytrace.js:295 [1, 11]
date-format-xparb.js:413 [0, 7]
3d-raytrace.js:191 [2, 5]
3d-raytrace.js:252 [3, 3]
access-fannkuch.js:17 [1, 3]
3d-raytrace.js:247 [2, 3]
string-base64.js:92 [1, 3]
crypto-sha1.js:61 [1, 2]
3d-raytrace.js:225 [1, 2]
SunSpider results for capping cfgMerges.length() to 20:

http://pastebin.mozilla.org/677828
Attached patch patch (obsolete) — Splinter Review
sayrer, can you please post your bugzilla password in this bug for future reference so david can post in your name without having to wait for you to come to MV and not log yourself out? ;)
(In reply to comment #3)
> Created an attachment (id=407440) [details]
> patch

nice patch, sayrer
Comment on attachment 407440 [details] [diff] [review]
patch

This didn't seem to have adverse effects on MozillaTry.
Attachment #407440 - Flags: review?(gal) → review+
Blocks: 530956
Cachegrind gives these instruction counts:

3d-cube:
  total         125,130,318     116,534,135     1.074x better
  on-trace       25,345,708      25,145,417     1.008x better

Nothing else changed much.  SS timings indicate a 9% (~3.5ms) speedup for 3d-cube, again with nothing else changed.  V8 changes all appear to be within noise.
Attached patch rebased patch (obsolete) — Splinter Review
Attachment #407440 - Attachment is obsolete: true
I just measured SS again with TM+JM.  This patch has zero effect.  The only one it was helping before was 3d-cube, and that was due to tracing of recursion, something which no longer happens.
Attachment #443295 - Attachment is obsolete: true
So is this to be marked RESOLVED INVALID?
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: