Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Faster dev cycle #3800

Open
davidmorgan opened this issue Jan 29, 2025 · 17 comments
Open

Faster dev cycle #3800

davidmorgan opened this issue Jan 29, 2025 · 17 comments
Assignees
Labels
P1 A high priority bug; for example, a single project is unusable or has many test failures type-enhancement A request for a change that isn't a bug type-performance

Comments

@davidmorgan
Copy link
Contributor

I've been digging into build_runner performance, and in particular, scalability of analyzer-based generators as the codebase grows.

It looks like there is room for significant improvement, so that's good :)

It's complicated, so I will need to move carefully with details discussed as I go.

First job will be to add some benchmarks #1335.

@gmpassos

This comment has been minimized.

@davidmorgan

This comment has been minimized.

@davidmorgan

This comment has been minimized.

@tenhobi

This comment has been minimized.

@rrousselGit

This comment has been minimized.

@davidmorgan
Copy link
Contributor Author

davidmorgan commented Feb 1, 2025

Thanks @tenhobi, thanks @rrousselGit.

I'm going to start marking comments I've replied to on this thread as "resolved" to keep it focused, since lots of people are watching it :) but I do appreciate the input.

Caching can certainly help, but it doesn't address the underlying problems, which are 1) performance, 2) granularity of invalidation.

I've created a sub-issue #3810 for granular invalidation, Remi I'll reply to your question there :)

I've also moved performance to a sub-issue #3811 so we can use this issue for overarching things.

@davidmorgan davidmorgan changed the title Faster builds Faster dev cycle Feb 1, 2025
@rrousselGit

This comment has been minimized.

@davidmorgan davidmorgan added type-enhancement A request for a change that isn't a bug P1 A high priority bug; for example, a single project is unusable or has many test failures labels Feb 1, 2025
@davidmorgan
Copy link
Contributor Author

For anyone who wants to follow PR by PR, they will be on the sub-issue for scalable performance #3811 for now :)

@gmpassos

This comment has been minimized.

@davidmorgan
Copy link
Contributor Author

The fastest proof of concept I have so far is about 6x faster on 1000 files, 120s incremental build -> 20s incremental build.

But I'm still laying the groundwork to make that landable, as I said, it's complicated :)

The benchmark right now at commit 7995cdd178 is

json_serializable      
libraries clean/ms no changes/ms incremental/ms
1 23021 3838 5415
100 23047 4067 7286
250 28944 4462 12391
500 40523 5944 29306
750 54127 7291 55905
1000 82186 10385 93929

which at 120s->94s is only 1.25x faster ;)

The code I'm merging is not actually live, needs BuildAssetUriResolver.sharedInstance changing to the new AnalysisDriverModel to use it; I'm considering whether there should be a temporary use-experimental-resolver flag to make it easier to try+compare. But anyway it should be more than 1.25x faster first ;)

@gmpassos

This comment has been minimized.

@davidmorgan

This comment has been minimized.

@gmpassos

This comment has been minimized.

@Jure-BB

This comment has been minimized.

@davidmorgan

This comment has been minimized.

@gmpassos

This comment has been minimized.

@davidmorgan
Copy link
Contributor Author

davidmorgan commented Feb 7, 2025

@gmpassos thanks! I've created a discussion for people who want to try and give feedback on the work-in-progress performance changes, I'll reply there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 A high priority bug; for example, a single project is unusable or has many test failures type-enhancement A request for a change that isn't a bug type-performance
Projects
None yet
Development

No branches or pull requests

5 participants