HeapProfiler: very slow ~4min "take snapshot time" for 80MB gmail heap.
authorloislo@chromium.org <loislo@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 10 Sep 2013 11:12:35 +0000 (11:12 +0000)
committerloislo@chromium.org <loislo@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 10 Sep 2013 11:12:35 +0000 (11:12 +0000)
commitf6b7ec4da0ed11afc072d613fbbab9d1db9154c8
tree200ffebceac999b3383ca905f1eb826900e83661
parent8b280df422a30f1edd56c09f41c3a518d4cface5
HeapProfiler: very slow ~4min "take snapshot time" for 80MB gmail heap.

The reason of that is a number of cons strings in the app.
The app constructs a json string and as a result v8 heap has
a very long chain of cons strings.

Profiler counts all these strings as plain String objects and
assign the content of the strings as node names.

It required O(n^2) time and O(n^2) memory.

Solution: I introduced two new types, kConsString and kSliced string.
They do not use the content of the string for names. So the problem disappeared.

The heap profiler usability problem will be solved on Blink side.

BUG=285770
R=yangguo@chromium.org

Review URL: https://codereview.chromium.org/23460027

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16611 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
include/v8-profiler.h
src/heap-snapshot-generator.cc
src/heap-snapshot-generator.h
test/cctest/test-heap-profiler.cc