Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(178)

Issue 9564012: Cache result of ScriptNameOrSourceURL function (Closed)

Created:
8 years, 9 months ago by yurys
Modified:
8 years, 9 months ago
Reviewers:
danno
CC:
v8-dev, pfeldman, eustas.com, loislo
Visibility:
Public.

Description

Cache result of ScriptNameOrSourceURL function. The function is quite slow on large(several MBs) scripts which causes significant slowdown when capturing stack trace for such scripts. Committed: https://code.google.com/p/v8/source/detail?r=10902

Patch Set 1 #

Total comments: 4

Patch Set 2 : #

Patch Set 3 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+13 lines, -3 lines) Patch
M src/messages.js View 1 2 3 chunks +13 lines, -3 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
yurys
8 years, 9 months ago (2012-03-01 17:41:02 UTC) #1
danno
LGTM with comments addressed. https://chromiumcodereview.appspot.com/9564012/diff/1/src/messages.js File src/messages.js (right): https://chromiumcodereview.appspot.com/9564012/diff/1/src/messages.js#newcode562 src/messages.js:562: sourceUrl = SubString(source, matchInfo[CAPTURE(2)], matchInfo[CAPTURE(3)]); ...
8 years, 9 months ago (2012-03-02 12:06:31 UTC) #2
yurys
8 years, 9 months ago (2012-03-02 12:22:20 UTC) #3
https://chromiumcodereview.appspot.com/9564012/diff/1/src/messages.js
File src/messages.js (right):

https://chromiumcodereview.appspot.com/9564012/diff/1/src/messages.js#newcode562
src/messages.js:562: sourceUrl = SubString(source, matchInfo[CAPTURE(2)],
matchInfo[CAPTURE(3)]);
On 2012/03/02 12:06:32, danno wrote:
> 80 col

Done.

https://chromiumcodereview.appspot.com/9564012/diff/1/src/messages.js#newcode565
src/messages.js:565: this.cachedNameOrSourceURL = sourceUrl || this.name;
On 2012/03/02 12:06:32, danno wrote:
> I think it's a bit more readable if you name the variable nameOrSourceURL and
> initialize it to this.name. That obviates the need for the use of the ||
> operator in this way.

Done.

Powered by Google App Engine
This is Rietveld 408576698