Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
4.6.1
-
None
-
None
-
QT 4.6.1, Symbian ^2, Symbian ^3 environments.
Description
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:
http://www.azillionmonkeys.com/qed/sqroot.html (Double)
http://en.wikipedia.org/wiki/Fast_inverse_square_root (Float)
We have prototyped this solution with good results. View rendering times dropped from 2.5s to 300ms (~10x increase)
Attachments
Issue Links
- is required for
-
QTBUG-7915 Symbian3_2010_06
- Closed