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

Issue 692093004: Optimize LineInfo.getLocation(). (Closed)

Created:
6 years, 1 month ago by Bob Nystrom
Modified:
6 years, 1 month ago
Reviewers:
Brian Wilkerson
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Optimize LineInfo.getLocation(). Three simple optimizations: 1. Do a binary search through _lineStarts to find the line instead of linear. 2. Store the last result and see if the offset starts there or later. If so, skip leading lines when searching. 3. See if the current offset is on the same line as the last result and exit early if so. On my benchmark test for the formatter, this reduced it from 13.23ms to 7.57ms. R=brianwilkerson@google.com Committed: https://code.google.com/p/dart/source/detail?r=41452

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+35 lines, -5 lines) Patch
M pkg/analyzer/lib/src/generated/source.dart View 2 chunks +35 lines, -5 lines 0 comments Download

Messages

Total messages: 5 (1 generated)
Bob Nystrom
I just changed the generated Dart file here. Is that OK? Thanks! - bob
6 years, 1 month ago (2014-10-31 20:28:34 UTC) #2
Brian Wilkerson
LGTM > I just changed the generated Dart file here. Is that OK? Yes! We ...
6 years, 1 month ago (2014-10-31 21:32:26 UTC) #3
Bob Nystrom
Committed patchset #1 (id:1) manually as 41452 (presubmit successful).
6 years, 1 month ago (2014-10-31 21:49:20 UTC) #4
Bob Nystrom
6 years, 1 month ago (2014-10-31 21:49:26 UTC) #5
Message was sent while issue was closed.
On 2014/10/31 21:32:26, Brian Wilkerson wrote:
> LGTM
> 
> > I just changed the generated Dart file here. Is that OK?
> 
> Yes! We are no longer generating the files, so hand edits are fine.

\o/

I didn't change the version in the pubspec. Is that OK?

Powered by Google App Engine
This is Rietveld 408576698