Changeset 96321 in webkit
- Timestamp:
- Sep 29, 2011 4:59:27 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r96320 r96321 1 2011-09-29 Ilya Tikhonovsky <loislo@chromium.org> 2 3 Web Inspector: speed-up Network panel. Change _staleResources type from array to object. 4 https://bugs.webkit.org/show_bug.cgi?id=69081 5 6 There is a test with 30 requests. 7 For the each stage of loading a resource we have an entry in _staleResources array. There are at least 4 stages per request. 8 NetworkLogView._refresh function is creating/updating the resource row for the each such entry. 9 This array can be replaced with a hash map just because the resource associated with the entry is the same for all the entries with the same request id. 10 11 Reviewed by Pavel Feldman. 12 13 Test: inspector/performance/resources/network-append-30-requests.html 14 15 * inspector/front-end/NetworkPanel.js: 16 (WebInspector.NetworkLogView): 17 (WebInspector.NetworkLogView.prototype._invalidateAllItems): 18 (WebInspector.NetworkLogView.prototype.refresh): 19 (WebInspector.NetworkLogView.prototype._reset): 20 (WebInspector.NetworkLogView.prototype._refreshResource): 21 1 22 2011-09-28 Pavel Feldman <pfeldman@google.com> 2 23 -
trunk/Source/WebCore/inspector/front-end/NetworkPanel.js
r96318 r96321 43 43 this._resourcesById = {}; 44 44 this._resourcesByURL = {}; 45 this._staleResources = [];45 this._staleResources = {}; 46 46 this._resourceGridNodes = {}; 47 47 this._lastResourceGridNodeId = 0; … … 579 579 _invalidateAllItems: function() 580 580 { 581 this._staleResources = this._resources.slice(); 581 for (var i = 0; i < this._resources.length; ++i) { 582 var resource = this._resources[i]; 583 this._staleResources[resource.requestId] = resource; 584 } 582 585 }, 583 586 … … 661 664 this._removeAllNodeHighlights(); 662 665 var wasScrolledToLastRow = this._dataGrid.isScrolledToLastRow(); 663 var staleItemsLength = this._staleResources.length;664 666 var boundariesChanged = false; 665 667 if (this.calculator.updateBoundariesForEventTime) { … … 668 670 } 669 671 670 for (var i = 0; i < staleItemsLength; ++i) {671 var resource = this._staleResources[ i];672 for (var resourceId in this._staleResources) { 673 var resource = this._staleResources[resourceId]; 672 674 var node = this._resourceGridNode(resource); 673 675 if (!node) { … … 688 690 // The boundaries changed, so all item graphs are stale. 689 691 this._invalidateAllItems(); 690 staleItemsLength = this._staleResources.length; 691 } 692 693 for (var i = 0; i < staleItemsLength; ++i) 694 this._resourceGridNode(this._staleResources[i]).refreshGraph(this.calculator); 695 696 this._staleResources = []; 692 } 693 694 for (var resourceId in this._staleResources) 695 this._resourceGridNode(this._staleResources[resourceId]).refreshGraph(this.calculator); 696 697 this._staleResources = {}; 697 698 this._sortItems(); 698 699 this._updateSummaryBar(); … … 722 723 this._resourcesById = {}; 723 724 this._resourcesByURL = {}; 724 this._staleResources = [];725 this._staleResources = {}; 725 726 this._resourceGridNodes = {}; 726 727 … … 783 784 _refreshResource: function(resource) 784 785 { 785 this._staleResources .push(resource);786 this._staleResources[resource.requestId] = resource; 786 787 this._scheduleRefresh(); 787 788 },
Note: See TracChangeset
for help on using the changeset viewer.