You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, benchmarks always run on background thread. It would be great if a new Toolchain and Executor are run on the same thread, or a property is added to existing toolchains/executors to control whether a background thread is created or not.
Actually, just came across this today - we need to benchmark with a native database ORM (Realm), which requires that its instance is created on the same thread that runs the code.
This fails with benchmarkdotnet as-is right now.
Actually, just came across this today - we need to benchmark with a native database ORM (Realm), which requires that its instance is created on the same thread that runs the code. This fails with benchmarkdotnet as-is right now.
Can't you just set it up in [GlobalSetup] (and tear it down in [GlobalCleanup])?
Activity
moritz-mg commentedon Jul 16, 2024
Actually, just came across this today - we need to benchmark with a native database ORM (Realm), which requires that its instance is created on the same thread that runs the code.
This fails with benchmarkdotnet as-is right now.
timcassell commentedon Jul 16, 2024
Can't you just set it up in
[GlobalSetup]
(and tear it down in[GlobalCleanup]
)?adamsitnik commentedon Jul 18, 2024
With the default toolchain no threads are being created and every benchmark is executed in a dedicated, standalone process.