While performance profiling FPC 2.0.2 on linux, I stumbled on this slowdown
depending on variable declarations:
program fpcBench;
{$mode objfpc}{$H+}
{ $APPTYPE CONSOLE}
uses
SysUtils;
var
x: double = 0;
i: double = 9999999;
startTime: TDateTime;
begin
startTime := Now;
while (i > 0) do i := i - 1;
Writeln('Elapsed: ' + IntToStr(DateTimeToTimeStamp(Now - startTime).Time));
end.
Commenting 'x: double = 0;' reduces performance 333%.
Any ideas what's going on?
And can somebody confirm this on other platforms?
Thanks!
--
Al
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives