google / google/built_value.dart

optimize building generated files

Open
#1,304 6 comments 0 reactions 1 assignee Claimed by @davidmorgan View on GitHub
question
Dominant language
Dart
Stars
886
Forks
195
Avg merge
1d 11h
Merged PRs (30d)
4

Description

Sorry, this may not be appropriate as a GitHub issue, but I just wanted to ask for advice/clarification on how `built_value` generates the `.g.dart` files.

My project has gotten to the point of using hundreds of `built_value` instances. It now takes about a minute to compile, sometimes two, which slows down development when testing several incremental changes consecutively.

In this comment with the OverReact authors: https://github.com/Workiva/over_react/issues/434#issuecomment-662475785, they suggest that built_value takes a while to compile on large projects because of its use of this package: https://pub.dev/packages/source_gen

I don't really understand the issues. I know OverReact itself generates code in `.g.dart` files, and I have about as many OverReact classes, of similar complexity, as built_value classes. Of course I don't know for sure that they are not also slowing things down, but according to the authors, their code generation is much faster.

So I'm wondering

1. Whether you agree that source code generation is slower with `source_gen` than other methods.
2. If you think there is some way (whether by switching away from `source_gen`, or something else) to speed up compilation.

Thank you.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.