Hi All.
Based upon the code into the post, I've driven a test case: three platforms and Delphi 5, Delphi XE, Lazarus 1.0.12 (FPC 2.6.2) For a comparison purpose, the main specific code has been written in a classical way, using implicit string and the optimized code uses the function result as explicit intermediate string.
All tests have been run the same way: the program has been reloaded for everyy run either classic or optimized
times shown are in minutes(always zero):seconds.ms Two loops have been done: 10 meg loops and 100 meg. There are the results:
Platform Vista 32
Delphi 5
10,000,000 iterations classic 00:05.735 - optimized 00:04.374 100,000,000 iterations classic 00:57.881 - optimized 00:44.386 Lazarus 1.0.12 Win32
10,000,000 iterations classic 00:02.487 - optimized 00:01.498 100,000,000 iterations classic 00:25.121 - optimized 00:16.528 Delphi XE on Vista32
10,000,000 iterations classic 00:01.757 - optimized 00:01.233 100,000,000 iterations classic 00:18.524 - optimized 00:13.204
Platform W7 x64 (virtual machine into Esxi4)
Delphi 5
10,000,000 iterations classic 00:05.491 - optimized 00:04.773 100,000,000 iterations classic 00:57.143 - optimized 00:49.780 Lazarus 1.0.12 Win32
10,000,000 iterations classic 00:03.213 - optimized 00:02.465 100,000,000 iterations classic 00:33.290 - optimized 00:25.21 Lazarus 1.0.12 Win64
10,000,000 iterations classic 00:03.962 - optimized 00:03.136 100,000,000 iterations classic 00:42.495 - optimized 00:34.523 Delphi XE w32
10,000,000 iterations classic 00:02.886 - optimized 00:02.153 100,000,000 iterations classic 00:31.013 - optimized 00:24.102
Platform Linux x64 (virtual machine into Esxi4)
Lazarus 1.0.12
10,000,000 iterations classic 00:03.348 - optimized 00:02.727 100,000,000 iterations classic 00:37.081 - optimized 00:28.810
Enjoy.
Antonio