roslyn icon indicating copy to clipboard operation
roslyn copied to clipboard

Move off of the final usage of an uncached AsyncLazy

Open CyrusNajmabadi opened this issue 3 years ago • 4 comments

Followup to https://github.com/dotnet/roslyn/pull/65719.

CyrusNajmabadi avatar Dec 05 '22 17:12 CyrusNajmabadi

@jasonmalinowski This is ready for review. Once this goes in, all usages of AsyncLazy cache their value, and we can move to that being the only functionality supported for it.

CyrusNajmabadi avatar Dec 07 '22 03:12 CyrusNajmabadi

Build: https://devdiv.visualstudio.com/DefaultCollection/DevDiv/_build/results?buildId=7065812&view=results PR is: https://dev.azure.com/devdiv/DevDiv/_git/VS/pullrequest/440423

CyrusNajmabadi avatar Dec 08 '22 00:12 CyrusNajmabadi

@jasonmalinowski no rps or speedometer issues. Can you ptal?

CyrusNajmabadi avatar Dec 08 '22 21:12 CyrusNajmabadi

@CyrusNajmabadi I think what might help here is a better understanding of what simplification this is saving us. As a direct tradeoff, I'd imagine this is adding as much code here as this would allow us to remove from AsyncLazy, but with potential new disadvantages.

To me, this is makign AsyncLazy simply much clearer and simpler. It lazily, asynchronously, computes a value, caching it once complete. That's literally how it's used for all but one case. Having it only be for that purpose, and having the odd case out clearly be odd, is a cleaner and simpler design.

If we commonly needed asynclazies that didn't cache, i would feel differently. But we dont'. So it feels like a very strange thing we bolted on for one use case, versus having that single case just be special.

CyrusNajmabadi avatar Dec 12 '22 18:12 CyrusNajmabadi

@jasonmalinowski any thoughts on moving forward on this. can take for 17.6 if you're concerned.

CyrusNajmabadi avatar Dec 15 '22 19:12 CyrusNajmabadi

Rebased to 17.6

CyrusNajmabadi avatar Dec 15 '22 19:12 CyrusNajmabadi

target main since it is 17.6 now

Cosifne avatar Jan 04 '23 20:01 Cosifne

Build is: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=7443567&view=results PR is: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=7443567&view=logs&j=7ae71e7c-d4fe-51ea-64cd-240849b77ab1&t=c4869a46-101d-5a27-7e56-5bbd31d167d6&l=16

CyrusNajmabadi avatar Mar 09 '23 02:03 CyrusNajmabadi

Build is: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=7572021&view=results PR is: https://dev.azure.com/devdiv/DevDiv/_git/VS/pullrequest/462793

CyrusNajmabadi avatar Apr 03 '23 19:04 CyrusNajmabadi

Build is: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=7599589&view=results PR is: https://dev.azure.com/devdiv/DevDiv/_git/VS/pullrequest/464186

CyrusNajmabadi avatar Apr 07 '23 22:04 CyrusNajmabadi

@jasonmalinowski val PR passed without any issues whatsoever: https://dev.azure.com/devdiv/DevDiv/_git/VS/pullrequest/464186

Can you ptal? I'd def like to simplify things here.

CyrusNajmabadi avatar Apr 11 '23 16:04 CyrusNajmabadi

@sharwell is yours a hard block? I'd like to move forward with this as i'm trying to continue workign in this space and i find both the deviation from the norm confusing, and also find it harder to reason about when working in the ValueSource/AsyncLazy/ITextAndVersionSource/RecoverableText do have these sorts of extra knobs and literal one-off behaviors :)

Thanks!

CyrusNajmabadi avatar Apr 14 '23 01:04 CyrusNajmabadi

Thanks both for the feedback and reviews.

CyrusNajmabadi avatar Apr 14 '23 17:04 CyrusNajmabadi