I could be wrong, but on Win32 InToStr() maps to System.Str().
function IntToStr(Value: integer): string;
begin
System.Str(Value, result);
end ;
That's right. On my Lazarus 64-bit Linux, it also maps to System.Str().
Tested the perfomance gain by bypassing StrToInt/IntToStr, unfortunately the gain is very small.
Original:
10000000, It took 2.956 secs
Using System.Str() directly:
10000000, It took 2.919 secs
Performance gain:
= (2.956 - 2.919) / 2.956 * 100%
= 1.25%
I have to admit, FPC/Lazarus is not well optimized compare to Delphi. That's understandable, Delphi is commercially/financially supported, it's expensive (for me). FPC/Lazarus is cross-platform supported by volunteers, the developers spend more time to make it cross-platform rather than optimizing it.