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

Issue 429173002: Don't cache path Context based on cwd, as cwd involves a system-call to compute. (Closed)

Created:
6 years, 4 months ago by Anders Johnsen
Modified:
6 years, 4 months ago
Reviewers:
nweiz, Bob Nystrom
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Don't cache path Context based on cwd, as cwd involves a system-call to compute. Instead, delay evaluation of cwd to the actual use of it. BUG= R=rnystrom@google.com Committed: https://code.google.com/p/dart/source/detail?r=38844

Patch Set 1 #

Total comments: 6

Patch Set 2 : Cleanup. #

Total comments: 3

Patch Set 3 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+20 lines, -19 lines) Patch
M pkg/path/CHANGELOG.md View 1 1 chunk +5 lines, -0 lines 0 comments Download
M pkg/path/lib/path.dart View 1 2 2 chunks +2 lines, -15 lines 0 comments Download
M pkg/path/lib/src/context.dart View 1 2 2 chunks +12 lines, -3 lines 0 comments Download
M pkg/path/pubspec.yaml View 1 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 12 (0 generated)
Anders Johnsen
This speeds up most of the common operations (basename, extension, etc) by a factor of ...
6 years, 4 months ago (2014-07-30 10:19:43 UTC) #1
Bob Nystrom
I really like this change, both the effect and the implementation. However, it's technically a ...
6 years, 4 months ago (2014-07-30 16:15:08 UTC) #2
nweiz
Don't forget to add a CHANGELOG entry for this. https://codereview.chromium.org/429173002/diff/1/pkg/path/pubspec.yaml File pkg/path/pubspec.yaml (right): https://codereview.chromium.org/429173002/diff/1/pkg/path/pubspec.yaml#newcode2 pkg/path/pubspec.yaml:2: ...
6 years, 4 months ago (2014-07-30 19:27:14 UTC) #3
Anders Johnsen
Good catch Bob, I've changed it. I did create is as a constructor, as creating ...
6 years, 4 months ago (2014-07-31 06:19:42 UTC) #4
Bob Nystrom
On 2014/07/31 06:19:42, Anders Johnsen wrote: > Good catch Bob, I've changed it. I did ...
6 years, 4 months ago (2014-07-31 15:42:20 UTC) #5
nweiz
I personally prefer the style Anders is using here.
6 years, 4 months ago (2014-07-31 19:30:24 UTC) #6
Bob Nystrom
On 2014/07/31 19:30:24, nweiz wrote: > I personally prefer the style Anders is using here. ...
6 years, 4 months ago (2014-07-31 23:17:44 UTC) #7
Bob Nystrom
I'd prefer making the internal constructor actually private, but LGTM. https://codereview.chromium.org/429173002/diff/20001/pkg/path/lib/src/context.dart File pkg/path/lib/src/context.dart (right): https://codereview.chromium.org/429173002/diff/20001/pkg/path/lib/src/context.dart#newcode45 ...
6 years, 4 months ago (2014-08-01 16:32:07 UTC) #8
Anders Johnsen
Did the change, landing :) https://codereview.chromium.org/429173002/diff/20001/pkg/path/lib/src/context.dart File pkg/path/lib/src/context.dart (right): https://codereview.chromium.org/429173002/diff/20001/pkg/path/lib/src/context.dart#newcode45 pkg/path/lib/src/context.dart:45: Context.internal() : style = ...
6 years, 4 months ago (2014-08-04 06:33:14 UTC) #9
Anders Johnsen
Committed patchset #3 manually as 38844 (presubmit successful).
6 years, 4 months ago (2014-08-04 06:40:25 UTC) #10
Anders Johnsen
https://codereview.chromium.org/429173002/diff/20001/pkg/path/lib/src/context.dart File pkg/path/lib/src/context.dart (right): https://codereview.chromium.org/429173002/diff/20001/pkg/path/lib/src/context.dart#newcode45 pkg/path/lib/src/context.dart:45: Context.internal() : style = Style.platform; On 2014/08/04 06:33:14, Anders ...
6 years, 4 months ago (2014-08-04 06:58:08 UTC) #11
Bob Nystrom
6 years, 4 months ago (2014-08-04 17:03:46 UTC) #12
Message was sent while issue was closed.
On 2014/08/04 06:58:08, Anders Johnsen wrote:
>
https://codereview.chromium.org/429173002/diff/20001/pkg/path/lib/src/context...
> File pkg/path/lib/src/context.dart (right):
> 
>
https://codereview.chromium.org/429173002/diff/20001/pkg/path/lib/src/context...
> pkg/path/lib/src/context.dart:45: Context.internal() : style = Style.platform;
> On 2014/08/04 06:33:14, Anders Johnsen wrote:
> > On 2014/08/01 16:32:07, Bob Nystrom wrote:
> > > Since _current is final, don't you need to initialize it to null here?
> > 
> > It's auto-initialized to null.
> 
> Ha, nice one Anders... You are of cause right - fixed in followup :)

:)

- bob

Powered by Google App Engine
This is Rietveld 408576698