Bug 59454 - Web Inspector: [Chromium] Detailed heap snapshot loading / parsing needs to be optimized
Summary: Web Inspector: [Chromium] Detailed heap snapshot loading / parsing needs to b...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Mikhail Naganov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-26 07:36 PDT by Mikhail Naganov
Modified: 2011-04-28 07:55 PDT (History)
10 users (show)

See Also:


Attachments
patch (11.13 KB, patch)
2011-04-26 07:39 PDT, Mikhail Naganov
yurys: review+
mnaganov: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail Naganov 2011-04-26 07:36:57 PDT
The current approach to snapshots loading and parsing is quite ineffective: first, the whole snapshot is loaded as a JSON string, then it is parsed as a whole. This leads to waste of memory, and can cause problems with _really_ big snapshots. It is possible to parse snapshot on the fly.
Comment 1 Mikhail Naganov 2011-04-26 07:39:52 PDT
Created attachment 91104 [details]
patch
Comment 2 Mikhail Naganov 2011-04-28 07:55:04 PDT
Manually committed http://trac.webkit.org/changeset/85182


2011-04-28  Mikhail Naganov  <mnaganov@chromium.org>

        Reviewed by Yury Semikhatsky.

        Web Inspector: [Chromium] Optimize detailed heap snapshots loading / parsing.
        https://bugs.webkit.org/show_bug.cgi?id=59454

        Test: inspector/profiler/heap-snapshot-loader.html

        * inspector/front-end/HeapSnapshot.js:
        (WebInspector.HeapSnapshotLoader):
        (WebInspector.HeapSnapshotLoader.prototype._findBalancedCurlyBrackets):
        (WebInspector.HeapSnapshotLoader.prototype.finishLoading):
        (WebInspector.HeapSnapshotLoader.prototype._parseNodes):
        (WebInspector.HeapSnapshotLoader.prototype._parseStringsArray):
        (WebInspector.HeapSnapshotLoader.prototype.pushJSONChunk):
        * inspector/front-end/HeapSnapshotProxy.js:
        (WebInspector.HeapSnapshotFakeWorker.prototype.postMessage):

2011-04-28  Mikhail Naganov  <mnaganov@chromium.org>

        Reviewed by Yury Semikhatsky.

        Web Inspector: [Chromium] Optimize detailed heap snapshots loading / parsing.
        https://bugs.webkit.org/show_bug.cgi?id=59454

        * inspector/profiler/heap-snapshot-loader-expected.txt: Added.
        * inspector/profiler/heap-snapshot-loader.html: Added.
        * inspector/profiler/heap-snapshot-test.js:
        (initialize_HeapSnapshotTest.InspectorTest.createHeapSnapshotMock):
        (initialize_HeapSnapshotTest):