相关疑难解决方法(0)

Julia 的表现远远优于 Delphi。Delphi 编译器的 asm 代码已过时?

我在 Delphi 中编写了一个简单的 for 循环。\n相同的程序在 Julia 1.6 中快了 7.6 倍。

\n
procedure TfrmTester.btnForLoopClick(Sender: TObject);\nVAR\n   i, Total, Big, Small: Integer;\n   s: string;\nbegin   \n  TimerStart;\n\n   Total:= 0;\n   Big  := 0;\n   Small:= 0;\n   for i:= 1 to 1000000000 DO    //1 billion\n    begin\n      Total:= Total+1;\n      if Total > 500000\n      then Big:= Big+1\n      else Small:= Small+1;\n    end;\n\n s:= TimerElapsedS;\n //here code to show Big/Small on the screen\nend;\n
Run Code Online (Sandbox Code Playgroud)\n

ASM 代码对我来说似乎不错:

\n
TesterForm.pas.111: TimerStart;\n007BB91D E8DE7CF9FF       call TimerStart\nTesterForm.pas.113: Total:= 0;\n007BB922 33C0             xor eax,eax\n007BB924 8945F4           mov [ebp-$0c],eax\nTesterForm.pas.114: Big …
Run Code Online (Sandbox Code Playgroud)

delphi julia

5
推荐指数
1
解决办法
373
查看次数

标签 统计

delphi ×1

julia ×1