benchmark_harness reusing unittests

53 vistas
Ir al primer mensaje no leído

Paul Evans

no leída,
26 nov 2014, 2:29:07 p.m.26/11/2014
para mi...@dartlang.org
For a quick and dirty benchmark I thought I might be able to just a unittest main called from via a class deriving from BenchmarkBase in benchmark_harness via a command line main().

The unittests expects are written synchronously - but the the benchmark reports complete to the console first, then all the deluge of PASS: things go out to the console.

I realise this is not the best way of writing a benchmark - it was just an unsuccessful experiment.  I would like to know why I am seeing the benchmark report come back before the the test PASS lines to the console though.
 

Lex Berezhny

no leída,
26 nov 2014, 2:45:55 p.m.26/11/2014
para misc
Doesn't appear that Benchmark handles async code.

Why do you need to benchmark async code?

Doesn't seem like it would give you useful results since you aren't just benchmarking Dart VM but also operating system I/O, etc.

Btw, here is the code I looked at before responding to your question:


--
For other discussions, see https://groups.google.com/a/dartlang.org/
 
For HOWTO questions, visit http://stackoverflow.com/tags/dart
 
To file a bug report or feature request, go to http://www.dartbug.com/new

To unsubscribe from this group and stop receiving emails from it, send an email to misc+uns...@dartlang.org.

Paul Evans

no leída,
27 nov 2014, 2:10:37 a.m.27/11/2014
para mi...@dartlang.org
*shrugs* I didn't think unittest was async unless you used expectAsync.  All my tests were synchronous math operations tested with expect, but the console output with all the PASSes came after the benchmark timing had already been displayed. Which surprised me.

Bob Nystrom

no leída,
1 dic 2014, 1:08:11 p.m.1/12/2014
para General Dart Discussion

On Wed, Nov 26, 2014 at 11:10 PM, Paul Evans <paul.d...@gmail.com> wrote:
*shrugs* I didn't think unittest was async unless you used expectAsync.  All my tests were synchronous math operations tested with expect, but the console output with all the PASSes came after the benchmark timing had already been displayed. Which surprised me.

If I remember right, unittest always runs your tests asynchronously even if the tests themselves are synchronous. Every call to group() or test() just enqueues the test case and once main() returns, unittest goes through and runs them all.

Cheers,

- bob

Paul Evans

no leída,
1 dic 2014, 1:20:59 p.m.1/12/2014
para mi...@dartlang.org
Thanks Bob! I figured something like that was going on but didn't dig deep enough.  What you say makes sense of what I observed :)

--
Responder a todos
Responder al autor
Reenviar
0 mensajes nuevos