[Interest] Benchmarking machine cpu power
Sean Harmer
sean.harmer at kdab.com
Sat Apr 26 16:17:29 CEST 2014
On Saturday 26 April 2014 11:24:52 maitai at virtual-winds.org wrote:
> Hello,
>
> I have an application which can be very cpu-intensive, depending on some
> options that play on the precision of computation (you can't expect the
> same precision in the same time on an Android phone or a multi-core
> latest cpu generation desktop).
>
> Ideally, I would like the application to tune automatically these
> options based on the ranking of the machine cpu-wise, let's say "slow",
> "normal", "fast".
>
> I will probably write my own small cpuTest routine, but I was wondering
> if there is something in Qt that could return such a benchmarking
> result?
How about allocating a time budget of x milliseconds then timing how long your
calculations take for precision = n. If it's too slow, reduce n. If it has
time to spare increase n. QElapsedTimer can help here.
If your algorithm can be parallelised then you may want to consider using >1
worker thread to distribute the work.
For such tight computations also check your data layout to minimise cache
misses. This can make a world of difference.
Cheers,
Sean
--
Dr Sean Harmer | sean.harmer at kdab.com | Managing Director UK
Klarälvdalens Datakonsult AB, a KDAB Group company
Tel. Sweden (HQ) +46-563-540090, USA +1-866-777-KDAB(5322)
KDAB - Qt Experts - Platform-independent software solutions
More information about the Interest
mailing list