Commit 027c2677 authored by Simon Zünd's avatar Simon Zünd Committed by Commit Bot

[js-perf] Improve end of serialize StackTrace benchmark

The serialize set of microbenchmarks serializes Error.stack of a
prepared set of error objects. When all objects have been serialized,
the benchmark then wrapped around and only accessed the resulting
string properties. This, of course, is a lot faster and benchmark
results are heavily fluctuating when the end is reached.

This CL fixes this by introducing a payload that should be similiar
to the specific workload, which is executed after the end is reached.

R=petermarshall@chromium.org

Bug: v8:8742
Change-Id: I7183d04e7c06af0c16fe3412e902f0d33605bc25
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1524485Reviewed-by: 's avatarPeter Marshall <petermarshall@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60297}
parent 8f1c985c
......@@ -71,9 +71,11 @@ function SerializeStack() {
// Trigger serialization by accessing Error.stack.
%FlattenString(errorsCreatedBySetup[counter++].stack);
} else {
// The counter is reset after hitting the end, although
// Error.stack is cached at this point.
counter = 0;
// All errors are serialized. The stack trace string is now cached, so
// re-iterating the array is a simple property lookup. Instead,
// a simple Error object is created and serialized, otherwise the benchmark
// result would fluctuate heavily if it reaches the end.
%FlattenString(new Error().stack);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment