Delphi improvement #372
mathias-burbach
started this conversation in
Improvement suggestions
Replies: 1 comment
-
With #264 already aiming to improve the existing Delphi solution, you could add a comment to that PR that points this out. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I managed to get the current implementation to achieve 2.2% more passes by avoiding an Exit call in TPrimeSieve.ClearBit by changing
procedure TPrimeSieve.ClearBit(Index: Integer);
begin
if (Index mod 2) = 0 then
Exit;
FBitArray[Index div 2] := False;
end;
to
procedure TPrimeSieve.ClearBit(Index: Integer);
begin
if (Index mod 2) = 1 then
FBitArray[Index div 2] := False;
end;
The Exit call causes more assembler code.
I am unsure how to get this improvement into the repository.
Salut,
Mathias
Beta Was this translation helpful? Give feedback.
All reactions