[fpc-devel] Float to string conversion performance

C Western l at c-m-w.me.uk
Sun Apr 15 21:41:58 CEST 2012

On 04/15/2012 06:41 PM, Florian Klaempfl wrote:
> Am 15.04.2012 17:03, schrieb Max Nazhalov:
>> Anyway, I ran that diff on the same conditions as above. Full test
>> suite did not show any regressions.
> This is already a good sign.
>> My test case resulted in:
>> "1.2345678901234568E+3999": FPC=1.92 seconds
>> "1.2345678901234568E-3999": FPC=1.83 seconds
>> so its timing is still about 2.5 times slower than Delphi, but much
>> better then before.
>> Can anyone review or test suggested changes before creating Mantis
>> entry?
> I guess nobody can competely oversee such changes to real2str so what
> about creating automatically a test program which converts a lot of
> random bit patters into strings by str(...) and compare the output of
> the old and new algorithm?

I think it tests a different code path, but the tests submitted as part 
of <http://bugs.freepascal.org/view.php?id=16907> might give you some 
ideas, as these picked out some specific numbers that were causing problems.


More information about the fpc-devel mailing list