-
-
Notifications
You must be signed in to change notification settings - Fork 976
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Discussion] Changes on Engine, diagnosers and result reporting? #297
Comments
I am not sure if we have any problem today.
|
Proof: with the recent diagnoser changes I was able to get 100% accurate memory diagnostics #284 |
Ok, what about case when there's no diagnosers? Can we delay result reporting till all runs are completed? Or, at least, introduce more obvious contract for it?
Afair standard input/output is buffered. So there can be multiple race combinations, simplest one:
both of these are not an issue for common benchmarks as they can easily take minute or two but I'd prefer to have something more robust for perftests as they're typically limited with 1-2 sec timeout. |
We could do so, so far @AndreyAkinshin wanted to have continuous updates.
I was not aware of that. Thanks! @ig-sinicyn I assume that you want to merge your perf test runner changes and the current Engine does not fit in well? Have you thought about creating a new class that would implement IEngine and reuse the code from Engine that you want (running tests, not displaying results to console etc) |
Ok, great!:)
Actually no, at least for now. I'm not sure most of our changes are required at all with bench.net v0.10. Our current design is following: each benchmark method performs few thousands iterations by itself [CompetitionBaseline]
public bool Test00IsDefined()
{
var a = false;
for (var i = 0; i < Count; i++)
a = EnumHelper.IsDefined(F.C | F.D);
return a;
}
[CompetitionBenchmark(28.00, 34.00)]
public bool Test02EnumIsDefined()
{
var a = false;
for (var i = 0; i < Count; i++)
a = Enum.IsDefined(typeof(F), F.C | F.D);
return a;
} (yep, EnumHelper.IsDefined() method is ~30x faster than Enum.IsDefined()) the engine measures time for each call (as if the invokeCount parameter here is 1) This produce precise results and entire test takes ~2.5 sec (no perf optimizations yet, will be faster),
it uses our own in-process toolchain, so we have no issues with replacing the engine so far. Our code is very close to the current implementation in bench.net so it looks like we can drop our custom engine with release of v0.10, but there's still an issue with diagnosers. |
UPD Yeah, I've checked all our perftests and current engine implementation from Benchmark.Net works fine for us. I've just switched to it as a default option. Cheers! The only issue we have for now is diagnoser support for in-process benchmarks. We definitely need something better than reading the stdout : ) |
@ig-sinicyn that's great! I have finished the universal memory diagnoser, but due to dependency to netcoreapp1.1 which is still in beta we need to wait until the end of November to get it RTM so we don't need to have two separate nuget packages again like we did with dnxcore50. @AndreyAkinshin IMHO Then we could merge Igor's changes to separate branch of BDN and I could work on having it work together with recent diagnosers changes without passing the results through standard input/output ;) So we could have something like: What do you guys think? |
LGTM |
@adamsitnik ok!:) |
InProcessToolchain has been merged a long time ago, I am closing this one |
DISCLAIMER: this issue is only to start a discussion, I have no good solution for it yet, sorry.
There're two major issues with current engine implementation.
Engine should report measurements by itself, as here. If missed, things go wrong; see [BUG] NRE in OutliersAnalyser #296.
The diagnoser support is implemented on top of result reporting. This hurts as there're additional allocations, and there's no proper synchronization. The diagnoser can receive signal after the benchmark was actually started.
To be honest I have no good idea how to fix it. As initial proposal:
Add diagnoser run as a separate engine stage.
During run-with-diagnoser stage:
During normal stages:
I think, there's no need to use any framework for IPC as it'll incur additional allocations and it'll add more latency. Not to mention there's no such lightweight framework out-of-the-box, only sockets, pipes and mem-mapped files available for netCore.
The text was updated successfully, but these errors were encountered: