mirror of
https://github.com/danieleteti/delphimvcframework.git
synced 2024-11-15 07:45:54 +01:00
Added "Speed" button in activerecord_showcase sample
This commit is contained in:
parent
8b7ec97819
commit
f0aa9e76d6
Binary file not shown.
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 43 KiB |
@ -1261,16 +1261,21 @@ var
|
||||
I: Integer;
|
||||
lCustomers: TArray<TCustomer>;
|
||||
lSW: TStopWatch;
|
||||
lElapsedMS: UInt32;
|
||||
const
|
||||
INSTANCES_COUNT = 2000000;
|
||||
begin
|
||||
TMVCActiveRecord.DeleteAll(TCustomer);
|
||||
SetLength(lCustomers, 2000000);
|
||||
SetLength(lCustomers, INSTANCES_COUNT);
|
||||
lSW := TStopwatch.StartNew;
|
||||
for I := Low(lCustomers) to High(lCustomers) do
|
||||
for I := 0 to INSTANCES_COUNT - 1 do
|
||||
begin
|
||||
lCustomers[I] := TCustomer.Create;
|
||||
end;
|
||||
Log('Created ' + Length(lCustomers).ToString + ' TCustomer instances in ' + lSW.ElapsedMilliseconds.ToString + 'ms');
|
||||
for I := Low(lCustomers) to High(lCustomers) do
|
||||
lElapsedMS := lSW.ElapsedMilliseconds;
|
||||
Log(Format('Created %s TCustomer instances in %d ms',
|
||||
[FormatFloat('###,###,###', INSTANCES_COUNT), lElapsedMS]));
|
||||
for I := 0 to INSTANCES_COUNT - 1 do
|
||||
begin
|
||||
lCustomers[I].Free;
|
||||
end;
|
||||
|
@ -164,6 +164,12 @@
|
||||
</Delphi.Personality>
|
||||
<Deployment Version="4">
|
||||
<DeployFile LocalName="bin\activerecord_showcase.exe" Configuration="BUILD" Class="ProjectOutput"/>
|
||||
<DeployFile LocalName="bin\activerecord_showcase.exe" Configuration="BUILD" Class="ProjectOutput">
|
||||
<Platform Name="Win32">
|
||||
<RemoteName>activerecord_showcase.exe</RemoteName>
|
||||
<Overwrite>true</Overwrite>
|
||||
</Platform>
|
||||
</DeployFile>
|
||||
<DeployFile LocalName="bin\activerecord_showcase.exe" Configuration="BULD" Class="ProjectOutput"/>
|
||||
<DeployFile LocalName="bin\activerecord_showcase.exe" Configuration="Debug" Class="ProjectOutput"/>
|
||||
<DeployFile LocalName="bin\activerecord_showcase.exe" Configuration="POSTGRESQL" Class="ProjectOutput"/>
|
||||
|
Loading…
Reference in New Issue
Block a user