-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
Hello,
Given a query dataset of 1.4M records, 6 fields, I have timed the query traversal using different approaches to see how much the RTTI readability would cost in terms of performance.
FieldByName within the loop: 11,121 ms
query.First;
while not query.Eof do begin
mystringvar := query.FieldByName ('A').AsString + query.FieldByName ('B').AsString + ...
query.next;
end
FieldByName before the loop: 9,590 ms
query.First;
fieldA := query.FieldByName ('A');
fieldB := query.FieldByName ('B');
while not query.Eof do begin
mystringvar := fieldA.AsString + fieldB.AsString + ...
query.next;
end
Using CmonLib's DatasetHelper: 14,356 ms
for myRec in vQuery.Records<TMyRec> do begin
mystringvar := myRec.A + myRec.B + ...
end;
Do you reckon there is a way to improve the performance of the CmonLib's approach so as to maintain the readability but with a lesser performance penalty?
Thanks!
Metadata
Metadata
Assignees
Labels
No labels