Open CyrusNajmabadi opened 1 month ago
(Triage) - starting with Cyrus, putting in 17.12
In addition to the current Balanced being a bad default for implementing and demoing a source generator, it's also a bad default for using them. This is not a good experience... I get this squiggle telling me I have an error until I save or build:
My expectation is the Balanced mode would also run generators after switching tabs in the editor. That wouldn't really help the case @stephentoub mentioned though.
@captainsafia
What if 'balanced' mode only penalized the v1 generators and left incremental ones to run more frequently?
What if 'balanced' mode only penalized the v1 generators and left incremental ones to run more frequently?
Incremental are still incredibly expensive. But they take things from "we're using 50GB of memory per keystroke, to like... 500MB". It's still bad, but you can throw hardware at it.
Currently, my view is that if users really need this sort of realtime experience, they can opt into it. But the vast majority of users don't need to be penalized when the vast majority of their edits have no SG impact whatsoever. 'Balanced' puts us in the mode that most SG systems in VS have run with (where they produce on save/build). And we have the knob for the subset of users that are ok giving up perf.
My problem with the default is it breaks the user experience. A key aspect of the VS experience is only getting red squiggles when things are broken. You shouldn't need to save/build for red squiggles to go away.
Understood. That's something we dont' love, but has to be weighed against the alternative, which is that performance across the board for all features has tanked. A key aspect of the VS experience was also being able to work fast and fluidly and scale up as needed. These two desires are in conflict, and we're opting to make the common case (where the majority of edits have no SG impact) good, while accepting that that means the uncommon edit may have a worse experience or take additional steps.
No idea if that's possible, but maybe the red squiggles could turn into gray squiggles when they are 'outdated' - to signal to the user that a save/build is necessary for them to refresh.
Or maybe re-run the SG after the user pauses for a few seconds.
If the user is looking at the file, that's a potential signal that we want to rerun that generator if they make changes to one of their source files.
Note: it would be good if we could just rerun that generator, not all generators.