Closed Bug 643643 Opened 14 years ago Closed 9 years ago

Analyze v8-splay performance

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: dmandelin, Assigned: dmandelin)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

v8/nocs is only 17% faster than js -a -m, but it's still worth checking out.
Attached file JS profiler output (deleted) —
Most of the time is spent in GeneratePayloadTree: function GeneratePayloadTree(depth, tag) { if (depth == 0) { return { array : [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ], string : 'String for key ' + tag + ' in leaf node' }; } else { return { left: GeneratePayloadTree(depth - 1, tag), right: GeneratePayloadTree(depth - 1, tag) }; } } A lot of GC time gets charged to this function, so that's probably most of the difference. We also spend 11% of total time on the array creation line--the object literals here are probably slowing us down a bit.
dmandelin, how are you running this test when you measure it? IIRC that function doesn't get included in the measurements when using the v8bench harness, but it does get included when you run using the Sunspider harness.
(In reply to comment #2) > dmandelin, how are you running this test when you measure it? IIRC that > function doesn't get included in the measurements when using the v8bench > harness, but it does get included when you run using the Sunspider harness. I was surprised by that as well. I run like this: SplaySetup(); var t0 = new Date; for (var i = 0; i < 1000; ++i) SplayRun(); print (new Date - t0); SplayTearDown(); If I don't actually run SplayRun, the time taken is 0ms, so I don't think SplaySetup is disturbing things too much in the profiler. I also verified that SplayRun calls InsertNewNode, which calls GeneratePayloadTree.
See bug 562553 and http://code.google.com/p/v8/issues/detail?id=690, especially comment 2 of that second link. > I also verified that > SplayRun calls InsertNewNode, which calls GeneratePayloadTree. SplayRun only calls InsertNewNode 80 times. SplaySetup calls it 8000 times. But you're running SplayRun 1000 times so it will dominate (ie. account for 90% of the InsertNewNode calls), and so your results should be ok AFAICT. Thanks for the clarification. This is such a stupid synthetic benchmark :(
I'm pretty sure all the V8 benchmarks have been thoroughly analyzed at this point.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: