Qt-embedded-interest Archive, October 2007
QString::number(double) is extremly slow
Message 1 in thread
Hi. I found one big problem with QString::number(double), it works VERY slow. Qt free and embedded edition 3.3.8, compiled for ARM (linux). It works slow both on board (rm9200) and in qemu.
Example:
QString s = QString::number(10.0);
I don't know exactly how much time it will take, but after 20 minutes of execution I interruped it with 'kill'. Going deeper in Qt, I found that this method calls non-trivial mathemathic and bitwise operations thousands of times! Why this is so slow ?
sprintf(str, "%f", 10.0) or printf(str, "%f", 10.0) works much faster.
I cann't use any class or method which uses QString::number(double) (QFont::key() for example) - it will hang up.
Any ideas ?
Thanks.
To unsubscribe - send "unsubscribe" in the subject to qt-embedded-interest-request@xxxxxxxxxxxxx
Message 2 in thread
configure with -DQT_QLOCALE_USES_FCVT
On Mon, Oct 22, 2007 at 08:28:46PM +0400, ÐÐÐÑÑÐÐ ÐÐÑÑÑÐÐ wrote:
> Hi. I found one big problem with QString::number(double), it works VERY slow. Qt free and embedded edition 3.3.8, compiled for ARM (linux). It works slow both on board (rm9200) and in qemu.
>
> Example:
>
> QString s = QString::number(10.0);
>
> I don't know exactly how much time it will take, but after 20 minutes of execution I interruped it with 'kill'. Going deeper in Qt, I found that this method calls non-trivial mathemathic and bitwise operations thousands of times! Why this is so slow ?
>
> sprintf(str, "%f", 10.0) or printf(str, "%f", 10.0) works much faster.
>
> I cann't use any class or method which uses QString::number(double) (QFont::key() for example) - it will hang up.
>
> Any ideas ?
>
> Thanks.
>
> To unsubscribe - send "unsubscribe" in the subject to qt-embedded-interest-request@xxxxxxxxxxxxx
>
To unsubscribe - send "unsubscribe" in the subject to qt-embedded-interest-request@xxxxxxxxxxxxx