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
performance: Stopwatch takes its time #17274
Comments
This comment was originally written by @tatumizer I, of course, meant only internal changes inside Stopwatch implementation, not API changes. |
This is a VM only problem (since dart2js obviously uses doubles already). Is this still a problem when your code gets optimized, or is it just the first initial calls to stopwatch that are slow? Removed Type-Defect label. |
This comment was originally written by @tatumizer This is part of a set of benchmarks where I always use 3 warmups, but results show only first warmup makes sense. Please run on WIndows (32 bit). WIth 64-bit, this won't be a problem. } |
cc @fsc8000. |
This comment was originally written by @tatumizer More accurate data: 2.7 GHz processor i7, with all SIMD instructions imaginable: Neither is good. |
Fwiw, I just ran this on my machine, and if I read the data correctly, it's now much faster. This was tested on my desktop (Intel(R) Xeon(R) CPU E5-2690 0 @ 2.90GHz) and my notebook (Intel(R) Core(TM) i7-4600U CPU @ 2.10GHz).
|
From my last measurements it looks like |
This issue was originally filed by @tatumizer
Stopwatch, widely used to benchmark performance, itself performs very badly! One invocation of elapsedMicroseconds takes 0.3 microseconds in 32-bit mode! Which makes it nearly impossible to implement any performance tool based on stopwatch - you will be benchmarking Stopwatch instead of a program.
The culprit: external method _now that returns huge number that doesn't fit in smi.
There's very easy fix: store start time as double and return _now as double. 52 integer bits in double is more than enough. This will do wonders in terms of speed. On 64-bit processors, performance will be more or less the same as with ints.
The text was updated successfully, but these errors were encountered: