Skip to content

[Discussion] Changes on Engine, diagnosers and result reporting? #297

@ig-sinicyn

Description

@ig-sinicyn

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.

  1. Engine should report measurements by itself, as here. If missed, things go wrong; see [BUG] NRE in OutliersAnalyser #296.

  2. 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:

    • Notify the diagnoser using any system synchronization primitive (e.g ManualResetEvent) (we do not want to allocate anything during run).
    • Wait for confirmation from the host (we do not want to run iteration until diagnoser receives the notification).
    • Run the iteration.
    • Notify diagnoser the run was completed & wait for confirmation.
  • During normal stages:

    • Do not write anything into console / output.
    • Result reporting should be responsibility of the caller, engine should only collect measurements into preallocated list.

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions