2016-04-29 10:11 GMT+02:00 Nuno Santos <nunosan...@imaginando.pt>: > > Code compiled and ruined fine but couldn’t notice a faster performance (I > have profiling timers in critical parts of the application). > > Has anyone done this before? > > As far as I know Qt is built with qreal as double as a default setting.
In case your cpu only does single precision floats in hardware: Maybe try to build Qt with qreal as single precision floats? I think the Qt configure option is "-qreal float", please check to be sure. Makes a notable difference on my ancient arm omap3 processor, at least. Also I'd recommend using the gcc warnings -Wdouble-promotion -Wfloat-conversion and make sure you are just using single precision floats as much as possible. Lots of performance is lost if you keep mixing single- and double precision. float a = 1.0f; float b = 2.0*a; // BAD! float b = 2.0f*a; // Good! Make sure you are using single-precision math functions (use std::sin, std::abs, not cmath sin, abs, etc). The warnings above will show you all these cases. Cheers, Ola
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest