Commit 9fc55a9d authored by Peter Marshall's avatar Peter Marshall Committed by Commit Bot

[cpu-profiler] Reduce size of circular queue to 512 KiB

This queue is used for transferring tick samples between the foreground
thread which creates them and the background thread which processes
them.

I've tested this on the node server example that we are using to
measure memory use and found that we never fill the queue at this size.

The load factor of the queue is basically a measure of how fast the
producer pushes to it and how fast the consumer processes samples from
it. To load test the configuration a bit I reduced the sampling
interval from 1000us (1000 samples/sec) to 50us (20,000 samples/sec).
At this rate we still only use 196/251 available slots in the queue at
peak load (measurement taken by keeping a running max of #slots used,
taken at StartEnqueue()).

The default sampling interval is 1000us. 512 KiB ought be enough for
anybody!

Bug: v8:7719

Change-Id: I93cc1119d3549a319d2db8b831781712bfb88613
Reviewed-on: https://chromium-review.googlesource.com/c/1397704Reviewed-by: 's avatarAlexei Filippov <alph@chromium.org>
Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58600}
parent 44b9f84c
......@@ -197,7 +197,7 @@ class SamplingEventsProcessor : public ProfilerEventsProcessor {
private:
SampleProcessingResult ProcessOneSample() override;
static const size_t kTickSampleBufferSize = 1 * MB;
static const size_t kTickSampleBufferSize = 512 * KB;
static const size_t kTickSampleQueueLength =
kTickSampleBufferSize / sizeof(TickSampleEventRecord);
SamplingCircularQueue<TickSampleEventRecord,
......
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