AsyncMethodBuilderAttribute and PoolingAsyncValueTaskMethodBuilder verbosity #5109
Unanswered
MithrilMan
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
reading about @stephentoub blog post about Net6 performance https://devblogs.microsoft.com/dotnet/performance-improvements-in-net-6/ (hey, I was out of breath after a few paragraphs, I can't imagine how much time you spent writing that stuff!) I read about AsyncMethodBuilderAttribute and PoolingAsyncValueTaskMethodBuilder
Since the main reason of AsyncMethodBuilderAttribute is to be able to specify a custom strategy for async method building, but considering that one of the most used/useful will probably be the PoolingAsyncValueTaskMethodBuilder, why don't you create a keyword specific for that, like
asyncpooled
/asyncp
/async pooled
whatever, so that we don't have to pollute async methos with attributes?what I mean is that instead having to write
we can just write
public static async pooled ValueTask ExampleAsync() { }
or asyncp or whatever new keyword that would specify that the async method will make use of pooled method builder
I kind of feel guilty to fill code with plenty of attributes :/
Beta Was this translation helpful? Give feedback.
All reactions