Board index » delphi » Fastcode Int64Div B&V 3.4.1
Dennis
Delphi Developer |
Fastcode Int64Div B&V 3.4.12006-09-21 03:21:14 AM delphi140 Hi All Let us have a look at the benchmark and find a way to make it better. We have 2 subbenchmarks and these to codesnippets are the loops we time Sub1 X1 := 1; while X1 <= MAXINT64-BENCHSTEPSIZE do begin Y1 := X1; while Y1 <= MAXINT64-BENCHSTEPSIZE do begin Z1 := Int64DivFunction(Y1, X1); Z2 := Int64DivFunction(Y1, X1); Inc(Y1, BENCHSTEPSIZE); end; Inc(X1, BENCHSTEPSIZE); end; X2 := -MAXINT64; while X2 <= -1-BENCHSTEPSIZE do begin Y2 := X2; while Y2 <= -1-BENCHSTEPSIZE do begin Z3 := Int64DivFunction(X2, Y2); Z4 := Int64DivFunction(X2, Y2); Inc(Y2, BENCHSTEPSIZE); end; Inc(X2, BENCHSTEPSIZE); end; Sub2 X3 := -10; while X3 <= 10 do begin Y3 := -MaxInt; Y3 := Y3 * 4; while Y3 <= MaxInt do begin Z5 := Int64DivFunction(X3, Y3); Z6 := Int64DivFunction(X3, Y3); Inc(Y3, 234567); end; Inc(X3); end; Best regards Dennis Kjaer Christensen |