On Saturday 26 April 2014 11:24:52 mai...@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.har...@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 _______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest