formatNumber performance

André Wöbbeking Woebbeking at onlinehome.de
Mon May 15 14:50:08 BST 2006


On Monday 15 May 2006 15:28, David Faure wrote:
> On Monday 15 May 2006 15:11, Thiago Macieira wrote:
> > John Tapsell wrote:
> > >Hi,
> > >  I use formatNumber from kdelibs (in trunk) a lot in ksysguard
> > > but the performance is awful.  It appears that it calls the
> > > config classes every time it's used.  This one function accounts
> > > for 10% of my CPU Usage in ksysguard.
> > >
> > >Can someone knowledgable look into this?  Can formatNumber be
> > > improved please?
> >
> > It could cache whatever configuration it needs, though it would
> > also mean running applications would not see a config change when
> > the user changed his settings.
> >
> > I guess the proper fix lies in KConfig.
>
> Are we talking about KLocale::formatNumber? Where does it read
> configuration from KConfig? I don't see that.

I wanted to suggest QLocale::toString() which it already uses with 
QString::number() implicitly. But now I don't know how does this follow 
the user setting e.g. for group separator or decimal point?


Cheers,
André




More information about the kde-core-devel mailing list