我正在将一些应用程序从32位Delphi移植到64位,这些应用程序进行了大量的文本处理,并注意到处理速度发生了极端变化。对一些过程进行了一些测试,例如,与32位编译相比,这个过程在64位上需要的时间已经超过了200%(2000+毫秒与~900相比)。
这种情况正常吗?
function IsStrANumber(const S: AnsiString): Boolean;
var P: PAnsiChar;
begin
Result := False;
P := PAnsiChar(S);
while P^ <> #0 do begin
if not (P^ in ['0'..'9']) then Exit;
Inc(P);
end;
Result := True;
end;
procedure TForm11.Button1Click(Sender: TObject);
Const x = '1234567890';
Var a,y,z: Integer;
begin
z := GetTickCount;
for a := 1 to 99999999 do begin
if IsStrANumber(x) then y := 0;//StrToInt(x);
end;
Caption := IntToStr(GetTickCount-z);
end;
StrToInt(x)
,是否会出现相同的问题? - Toby Allen