Replies: 1 comment
-
I don't think this is possible currently. Perhaps when #2589 is implemented you could start the benchmarks inside your dispatch callback. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In Avalonia, to run headless (=lookless, console) tests we pass test body into a callback, which is executed on the dedicated thread with all the UI properties set-up.
It looks something like this:
This approach works well with XUnit and NUnit unit tests frameworks, allowing as to customize configuration per each test if necessary.
AvaloniaFact
internally runsDispatch
method, and restarts Avalonia application on each test.My question is, is it possible to achieve similar in BenchmarkDotNet? It's important, that benchmarking code excludes any headless session setup time, and only measures what's inside of the callback. Meaning, we can't just put
session.Dispatch
inside of the[Benchmark]
method.Beta Was this translation helpful? Give feedback.
All reactions