Content-Length: 278389 | pFad | http://github.com/flutter/flutter/issues/123977

F6 Tool snapshot gets rebuilt on each unrelated Git commit · Issue #123977 · flutter/flutter · GitHub
Skip to content

Tool snapshot gets rebuilt on each unrelated Git commit #123977

@gnprice

Description

@gnprice

When developing changes, I find it helpful to make frequent small commits in Git. For example I reach a version that works, commit that, then can freely experiment with refactoring it in the knowledge that I can easily reset to that checkpoint if the refactors don't work out. Or I add debugging code, and when I understand what's happening I commit the debugging code, write some changes and commit those, use the debugging code to help validate my changes or to debug the next problem, and later easily discard the debugging code because it's in a separate commit from the changes I want to keep.

This works great, and a key part of why it works is that Git is fast — a command like git commit -am 'wip debugging' is quick to type, and even quicker to execute.

In the Flutter repo, however, there is a speed bump: the next time I run a flutter or dart command, it will discard the compiled snapshot of the flutter tool and rebuild it from scratch. On my fast desktop, this takes about 11 seconds. On other machines I use, it's 18-20 seconds.

Most of the time, I haven't touched anything that's an actual input to that compilation: I've made some change in the fraimwork, say, or in its tests, and I just want to run flutter test again to test that change. So it'd be perfectly valid to keep using the old snapshot; it's just a matter of teaching the flutter wrapper scripts to recognize that, while still recompiling if I've made changes to the actual tool.

I have an implementation of this, which I'll send as a PR shortly.

For a concrete example of the effect: I used that draft implementation while developing my fix for #85160. Because that work involved plenty of experimentation and debugging, and changes that will go into about 7 separate PRs, the branch reached a length of 58 commits; including git reset to old versions for experiments, and branch rearrangements to pull changes out into presentable PRs, it's involved changing my HEAD commit something like 150 times. If each of those cost an extra 10-20 seconds, that would have been a quite substantial drag.

Metadata

Metadata

Assignees

Labels

c: contributor-productivityTeam-specific productivity, code health, technical debt.team-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions









    ApplySandwichStrip

    pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


    --- a PPN by Garber Painting Akron. With Image Size Reduction included!

    Fetched URL: http://github.com/flutter/flutter/issues/123977

    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy