RESOLVED FIXED 158054
Web Inspector: capturing with Allocations timeline causes GC to take 100x longer and cause frame drops
https://bugs.webkit.org/show_bug.cgi?id=158054
Summary Web Inspector: capturing with Allocations timeline causes GC to take 100x lon...
Blaze Burg
Reported 2016-05-24 20:55:24 PDT
STEPS TO REPRODUCE: 1. Make a recording without allocations timeline, note the smooth framerate. 2. Make a new recording with allocations timeline enabled. EXPECTED: No change in framerate, maybe a small increase in GC ACTUAL: GC time goes from < 1ms to > 60ms, causing visible stutters NOTES: The page continues to stutter even after recording is stopped, and after the allocations timeline is turned off. The latter seems to indicate a separate bug, where we don't turn off the extra tracking work during GC.
Attachments
WIP for Brian to try out (2.84 KB, patch)
2016-05-30 10:07 PDT, Saam Barati
no flags
WIP for Brian # 2 (6.93 KB, patch)
2016-05-30 12:30 PDT, Saam Barati
no flags
WIP for Brian # 3 (1.59 KB, patch)
2016-05-30 12:59 PDT, Saam Barati
no flags
patch (3.95 KB, patch)
2016-05-31 11:16 PDT, Saam Barati
joepeck: review+
patch for landing (4.12 KB, patch)
2016-05-31 11:40 PDT, Saam Barati
no flags
patch for landing (3.99 KB, patch)
2016-05-31 11:53 PDT, Saam Barati
buildbot: commit-queue-
Archive of layout-test-results from ews102 for mac-yosemite (996.52 KB, application/zip)
2016-05-31 12:30 PDT, Build Bot
no flags
Blaze Burg
Comment 1 2016-05-24 21:34:52 PDT
Saam Barati
Comment 2 2016-05-29 17:04:02 PDT
Is there a reason HeapSnapshot doesn't have a HashSet of JSCells' so it doesn't have to binary search every time? I ran some numbers and we only find something through the binary search 10% of the time on this website. So it's quite valuable to not binary search.
Saam Barati
Comment 3 2016-05-30 10:07:49 PDT
Created attachment 280101 [details] WIP for Brian to try out
Saam Barati
Comment 4 2016-05-30 12:30:49 PDT
Created attachment 280108 [details] WIP for Brian # 2
Saam Barati
Comment 5 2016-05-30 12:59:34 PDT
Created attachment 280109 [details] WIP for Brian # 3
Joseph Pecoraro
Comment 6 2016-05-31 10:50:05 PDT
Comment on attachment 280109 [details] WIP for Brian # 3 View in context: https://bugs.webkit.org/attachment.cgi?id=280109&action=review > Source/JavaScriptCore/heap/HeapSnapshot.h:56 > + uintptr_t m_filter { 0 }; Is this the same as TinyBloomFilter?
Joseph Pecoraro
Comment 7 2016-05-31 10:54:05 PDT
Comment on attachment 280108 [details] WIP for Brian # 2 View in context: https://bugs.webkit.org/attachment.cgi?id=280108&action=review > Source/JavaScriptCore/heap/HeapSnapshot.h:56 > + HashMap<JSCell*, HeapSnapshotNode> m_nodes; I think this adds 30% extra memory use for a HeapSnapshot on the backend. HeapSnapshotNode is a (JSCell*, unsigned) and now this stores an extra pointer per-live-node. Keeping the memory use on the backend low is a concern to avoid jetsams when taking heap snapshots on iOS.
Joseph Pecoraro
Comment 8 2016-05-31 11:02:52 PDT
(In reply to comment #2) > Is there a reason HeapSnapshot doesn't have a HashSet of JSCells' so it > doesn't have to binary search every time? The reason was to keep snapshots as small as possible. Since it keeps memory per-live-node, it grows with the number of objects in the heap. If a heap is large, and a snapshot requires a lot of memory, we won't succeed. > I ran some numbers and we only find something through the binary search > 10% of the time on this website. So it's quite valuable to not binary search. Good numbers to have! A filter (like your patch #3) was exactly what I was thinking we should do. Also, if needed, this work can be done in parallel. These snapshots, once finalized, can be safe to act on concurrently. For sweeping, each dead cell is unique, and sweeping marks the unique cell as dead and sets a shared flag in one direction (m_hasCellsToSweep = true). The shrinking can then done after the parallel work.
Saam Barati
Comment 9 2016-05-31 11:16:40 PDT
Joseph Pecoraro
Comment 10 2016-05-31 11:22:52 PDT
Comment on attachment 280157 [details] patch r=me!
Saam Barati
Comment 11 2016-05-31 11:40:42 PDT
Created attachment 280161 [details] patch for landing
Saam Barati
Comment 12 2016-05-31 11:53:50 PDT
Created attachment 280163 [details] patch for landing Fixed capitalization on my name
Build Bot
Comment 13 2016-05-31 12:29:58 PDT
Comment on attachment 280163 [details] patch for landing Attachment 280163 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/1413716 Number of test failures exceeded the failure limit.
Build Bot
Comment 14 2016-05-31 12:30:04 PDT
Created attachment 280167 [details] Archive of layout-test-results from ews102 for mac-yosemite The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews102 Port: mac-yosemite Platform: Mac OS X 10.10.5
Saam Barati
Comment 15 2016-05-31 12:44:21 PDT
Saam Barati
Comment 16 2016-05-31 12:45:16 PDT
(In reply to comment #14) > Created attachment 280167 [details] > Archive of layout-test-results from ews102 for mac-yosemite > > The attached test failures were seen while running run-webkit-tests on the > mac-ews. > Bot: ews102 Port: mac-yosemite Platform: Mac OS X 10.10.5 These don't seem related at all to this patch.
Note You need to log in before you can comment on or make changes to this bug.