New issue
Advanced search Search tips

Issue 692045 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Feb 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

free() calls taking 100us on release builds

Project Member Reported by rmcilroy@chromium.org, Feb 14 2017

Issue description

While investigating some performance issues, I found that free() was taking upwards of 100us for each call (for large free blocks allocated by V8's zone allocator). This was unexpected since free should be relatively cheap even when freeing large blocks of memory.

After investigating with Primiano we found that this is due to the tracked_objects.cc initializing ThreadHeapUsageTracker heap tracking unconditionally even on release builds. It doesn't seem reasonable that we enable heap tracking on release builds which in-turn changes the performance profile of free calls by 10-100x. Could we put this behind a runtime flag which is enabled when the user wants to profile heap usage?
 
Owner: siggi@chromium.org
I took a look to this with Ross today. There was a surprise factor that I completely forgot about: the THreadHeapUsageTracker seems to be always on for everything (% official builds).
By looking at the v8 traces Ross was analyzing, the cost of free() calls was 1-2 order of magnitude higher.
IIRC the historical reason is that somebody (Bruce?) had concerns about perf intrusiveness on this, which seems to be confirmed by Ross' findings.

Proposed solution: can we make this:

- a cmdline argument
OR
- a chrome://flags 
OR
- something that can be dynamically turned on (one off) via devtoools, so you can make an extension button for it?

For the first two options, I'm happy to share/recycle the existing --enable-heap-profiling and have --enable-heap-profiling=task-profiler or similar (which enables only your feature, not the full heap profiler)
WDYT?

Comment 2 by siggi@chromium.org, Feb 14 2017

Sorry guys to trip you up like this. I like the cmdline argument.

Comment 3 by siggi@chromium.org, Feb 14 2017

Status: Started (was: Untriaged)
Awesome, thanks for the quick fix Siggi!

Comment 6 by siggi@chromium.org, Feb 21 2017

Status: Fixed (was: Started)

Sign in to add a comment