You are not logged in.
Offline
I am dubious this article is very accurate.
Speaking of 'integer division' for a division per a constant on a recent compiler, in the context of performance is wrong.
Any good compiler (gcc, clang, FPC but not Delphi) is able to replace a " x / 10 " with a multiplication with the 32-bit or 64-bit reciprocal.
I do not see how its implementation may be faster than our StrUInt32() or StrUInt64() asm for i386 or x86_64.
In the context of pascal, the real bottleneck of IntToStr() is not the text computation, it is the string allocation.
Offline
I am dubious this article is very accurate.
Speaking of 'integer division' for a division per a constant on a recent compiler, in the context of performance is wrong.
Any good compiler (gcc, clang, FPC but not Delphi) is able to replace a " x / 10 " with a multiplication with the 32-bit or 64-bit reciprocal.I do not see how its implementation may be faster than our StrUInt32() or StrUInt64() asm for i386 or x86_64.
In the context of pascal, the real bottleneck of IntToStr() is not the text computation, it is the string allocation.
True.
Don't know how that algorithm would perform, I would say just by reading the article and looking at Delphi implementation.
My gut feeling is that the speed up promises of that article are way too large. Donät understand C/C++ enough that I could port that code to Delphi/Object Pascal.
-Tee-
Offline