Skip to content

Conversation

@jcollins-g
Copy link
Contributor

Claw back the performance lost since 0.42.0 with this one simple trick!

Reduces the 6% performance lost since 0.42.0 documenting flutter to ~.5% (almost within margin of error).

@google-cla google-cla bot added the cla: yes Google CLA check succeeded. label May 11, 2021
@jcollins-g jcollins-g requested a review from srawlins May 11, 2021 17:42
Folder __directoryCurrent;
Folder get _directoryCurrent =>
resourceProvider.getFolder(resourceProvider.pathContext.current);
__directoryCurrent ??= resourceProvider.getFolder(_directoryCurrentPath);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOL I am pretty sure I've considered this optimization and dismissed it thinking I dunno what this crazy package does 😆

Also, just to be sure; bizarro stuff like @tool shouldn't affect this, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I just assumed every time I implemented one of these layers of abstraction that some other layer was caching it. Apparently not :-D. Tools might change the working directory in a subprocess, but we're fine for the parent.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.003%) to 57.694% when pulling e814fd0 on jcollins-g:cache-cwd into bd11290 on dart-lang:master.

@jcollins-g jcollins-g merged commit 09e05d1 into dart-lang:master May 11, 2021
@jcollins-g jcollins-g deleted the cache-cwd branch May 11, 2021 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes Google CLA check succeeded.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants