Priority: P1: Critical
Affects Version/s: 4.6.1
Fix Version/s: 4.6.1
QT 4.6.1, Symbian ^2, Symbian ^3 environments.
Qt's port to symbian uses S60's OpenC libm math library for all mathematical operations. In particular sqrt() is extremely slow.
We are prototyping using QWebview along with the use of CSS 3 gradient colors. The implementation of gradient calculations in QtGui relies heavily on sqrt(). In our profiling, we have found that sqrt() operations account for over 80% of the execution time. For example fetchRadialGradient() in qDrawhelper.cpp, there is a tight while loop which calls qSafeSqrt() for each pixel.
Firstly, the use of OpenC's sqrt() should be examined as it calls the sqrt(double) version insead of sqrt(float). The QT sqrt calls are wrapped to qSqrt() in corelib's math.h.
Secondly, we would like to propose the usage of a fast sqrt calulation. [to speed up execution at the loss of precision especially for mobile cases]. If this can be configurable for math intensive calculations such as gradients Gui performance will improve significantly. [Also making the sqrt function inline is 20-30% faster than calling a separate routine]
A well known implementation of inverse newton's sqrt() can be found at these locations:
We have prototyped this solution with good results. View rendering times dropped from 2.5s to 300ms (~10x increase)