✅ Release slower than Debug
I'm doing some benchmarks on two async methods and strangely for both, they consistently have twice the execution time on Release vs Debug. I have the default project settings regarding configurations and sadly I can't share the code but I'd like some clues at what could cause such issues in general as I couldn't find much info
11 Replies
sorry if i ask, but did you do a serious benchmark or a jerry rigged benchmark?
Just Stopwatch but the results are very consistent
Are you sure you're properly isolated?
You might have a cold start issue somewhere
Like some caching from having ran Debug more than Release?
I'll try cold start on a different machine to be sure
Not so much that
But proper benchmarks are going to warm things up, etc
Trying now with BenchmarkDotNet
is this microbenchmarking, like in nano/micro, or like seconds?
Depends on how some things are laid out too from a lazy assembly load perspective
Kinda unfortunate though as the line of acceptable performance in this case sits right in between what I'm getting in both scenarios
Are you executing just once?
yeah, reworking it for a more robust benchmark now
.... actually realizing running more than once isn't possible :NotLikeThis:
Anyway can't really share more details but thanks for the tips
Adjusted to support multiple runs and indeed it seems to be a coldboot issue. After 10 runs the runtime decreases tehfold
:Stonks: