Usage of ValueTask in BaseAssertCondition #1850
AnnaSasDev
started this conversation in
Ideas
Replies: 2 comments 4 replies
-
If you create a pull request I can run the pipeline against it and tests should verify if things are actually broken or not |
Beta Was this translation helpful? Give feedback.
1 reply
-
After updating to TUnit v0.13.0 in my benchmarks both the memory consumption and the runtime went up: I don't see any other change in the changelog that could have caused this as they seem to be more in the "Engine"-area... @AnnaSasDev: Are you sure, that |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
After analyzing the source code, I noticed that
Task
is used extensively, even in execution paths that do not involve actual asynchronous operations. SinceTask
allocations introduce unnecessary overhead, replacing them withValueTask
in these cases would be more efficient.ValueTask
avoids a lot of overhead when returning completed results synchronously, theoretically improving performance.I've tried to compile some of these changes of
Task
toValueTask
in https://github.com/AnnaSasDev/TUnit/tree/valuetask but I'm unsure if this is correctly working given I don't have a deep understanding of the implications it might have on auto generated code. When I try to run all tests, a lot of them are failing (the same that are failing before the changes), so I can't very with 100% certainty that this won't affect anything.(and yes, if this is something that is moved forward, then the docs about custom assert conditions have to be edited again 😅 )
Beta Was this translation helpful? Give feedback.
All reactions