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

Issue 1468343002: Improve the performance of isWithin(). (Closed)

Created:
5 years ago by nweiz
Modified:
5 years ago
Reviewers:
Bob Nystrom
CC:
reviews_dartlang.org
Base URL:
git@github.com:dart-lang/path@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Improve the performance of isWithin(). This adds a single-pass fast path function that only bails when it encounters "." or ".." components in one path but not the other. This brings isWithin() from about 0.008 iterations/us to about 0.0180 by the repo's benchmark. It makes it about 11.5x faster on data provided by @scheglov (see below), which consists of absolute paths that mostly do not contain one another. Data: https://github.com/dart-lang/path/issues/7#issuecomment-157856146 Closes #7 R=rnystrom@google.com Committed: https://github.com/dart-lang/path/commit/e6b55472da7bfcfcc20db163abadfbd7689dd23c

Patch Set 1 #

Patch Set 2 : remove -dev #

Total comments: 8
Unified diffs Side-by-side diffs Delta from patch set Stats (+311 lines, -8 lines) Patch
M CHANGELOG.md View 1 chunk +5 lines, -0 lines 0 comments Download
M benchmark/benchmark.dart View 1 chunk +1 line, -0 lines 0 comments Download
M lib/src/context.dart View 3 chunks +248 lines, -7 lines 8 comments Download
M pubspec.yaml View 1 1 chunk +1 line, -1 line 0 comments Download
M test/posix_test.dart View 1 chunk +11 lines, -0 lines 0 comments Download
M test/url_test.dart View 1 chunk +23 lines, -0 lines 0 comments Download
M test/windows_test.dart View 1 chunk +22 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (2 generated)
nweiz
5 years ago (2015-11-24 04:59:39 UTC) #1
Bob Nystrom
https://codereview.chromium.org/1468343002/diff/20001/lib/src/context.dart File lib/src/context.dart (right): https://codereview.chromium.org/1468343002/diff/20001/lib/src/context.dart#newcode542 lib/src/context.dart:542: bool _isWithinFast(String parent, String child) { Possibly dumb question. ...
5 years ago (2015-11-24 17:22:13 UTC) #2
Bob Nystrom
Also: benchmark and numbers?
5 years ago (2015-11-24 17:25:32 UTC) #3
nweiz
> Also: benchmark and numbers? Done. https://codereview.chromium.org/1468343002/diff/20001/lib/src/context.dart File lib/src/context.dart (right): https://codereview.chromium.org/1468343002/diff/20001/lib/src/context.dart#newcode542 lib/src/context.dart:542: bool _isWithinFast(String parent, ...
5 years ago (2015-12-01 00:15:15 UTC) #5
Bob Nystrom
lgtm
5 years ago (2015-12-01 00:38:16 UTC) #6
nweiz
5 years ago (2015-12-01 04:18:56 UTC) #8
Message was sent while issue was closed.
Committed patchset #2 (id:20001) manually as
e6b55472da7bfcfcc20db163abadfbd7689dd23c (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698