Release mode is fast both with and without this change. I noticed that our styles are taking too long to recalc though (due to selector complexity?)
Created attachment 48704 [details] [PATCH] Proposed change.
Comment on attachment 48704 [details] [PATCH] Proposed change. > + var span = this._cachedSpans[this._cachedSpans.length - 1]; > + this._cachedSpans.length--; I am surprised this works! You should just use the pop() function. This is done in a few other places. I also don't understand how this helps much, since you just cache te elements, but the contents are replaces every time. r+ if you change to use pop() before landing.
(In reply to comment #2) > (From update of attachment 48704 [details]) > > > + var span = this._cachedSpans[this._cachedSpans.length - 1]; > > + this._cachedSpans.length--; > > I am surprised this works! You should just use the pop() function. This is done > in a few other places. > > > I also don't understand how this helps much, since you just cache te elements, > but the contents are replaces every time. Scrolling a large document slowly needs thousands of spans to be created at runtime for the highlight, thousands of rows to be created for lines. Native elements are allocated in heap, js wrappers are created for all of them since they are used in our code. Caching allows to limit number of created spans to a couple of hundreds. > > r+ if you change to use pop() before landing. Done. Committing to http://svn.webkit.org/repository/webkit/trunk ... M WebCore/ChangeLog M WebCore/inspector/front-end/SourceFrame.js M WebCore/inspector/front-end/TextViewer.js Committed r54756