Skip to content

Commit 40a245b

Browse files
committed
unroll loop a bit
1 parent 5df5095 commit 40a245b

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

entries/ghatem-fpc/src/OneBRC.lpr

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,8 +465,21 @@ procedure TOneBRC.ProcessData (aThreadNb: TThreadCount; aStartIdx: Int64; aEndId
465465
Inc (I, 5);
466466
end;
467467

468-
while FData[i] <> #10 do begin
469-
Inc (I);
468+
// unroll a few seems to be improving?
469+
if FData[i] <> #10 then begin
470+
Inc (i);
471+
if FData[i] <> #10 then begin
472+
Inc (i);
473+
if FData[i] <> #10 then begin
474+
Inc (I);
475+
if FData[i] <> #10 then begin
476+
Inc (i);
477+
while FData[i] <> #10 do begin
478+
Inc (I);
479+
end;
480+
end;
481+
end;
482+
end;
470483
end;
471484

472485
// new line parsed, process its contents

0 commit comments

Comments
 (0)