32 bit fast, 64 bit slow
Hello, this is my first post. Thanks for looking at it. I am using FR 5.2 in DXE7, and the list produces exactly what I want - a list of printers and the trays that are available for that printer.
This test runs in under half a second in a 32 bit compilation, but when I switch to 64 bit, the test takes at least 15 seconds! Has anyone any idea why it would be so slow? Is there a way to avoid using the frxPrinter object, and get the same results using the Windows API?
uses
..., frxPrinter;
procedure TfrmTest.Button1Click(Sender: TObject);
var
aRpt: TfrxPrinters;
i, j: integer;
stop, start: TDateTime;
begin
start := Now;
aRpt := TfrxPrinters.Create;
try
for i := 0 to aRpt.Printers.Count-1 do
begin
for j := 0 to aRpt.Items.Bins.Count-1 do
ListBox1.Items.Add(aRpt.Items.Name + '-' + aRpt.Printer.Bins[j]);
end;
finally
aRpt.Free;
end;
stop := Now;
ListBox1.Items.Add('Elapsed time (nn:ss:zz): ' + FormatDateTime('nn:ss:zz', stop - start));
end;
The TDateTimes and ListBox are only to illustrate the problem. I should add that the 64 bit library path looks at C:\Program Files (x86)\FastReports\LibD22x64, whereas the 32 bit path is C:\Program Files (x86)\FastReports\LibD22.
Regards, Peter
This test runs in under half a second in a 32 bit compilation, but when I switch to 64 bit, the test takes at least 15 seconds! Has anyone any idea why it would be so slow? Is there a way to avoid using the frxPrinter object, and get the same results using the Windows API?
uses
..., frxPrinter;
procedure TfrmTest.Button1Click(Sender: TObject);
var
aRpt: TfrxPrinters;
i, j: integer;
stop, start: TDateTime;
begin
start := Now;
aRpt := TfrxPrinters.Create;
try
for i := 0 to aRpt.Printers.Count-1 do
begin
for j := 0 to aRpt.Items.Bins.Count-1 do
ListBox1.Items.Add(aRpt.Items.Name + '-' + aRpt.Printer.Bins[j]);
end;
finally
aRpt.Free;
end;
stop := Now;
ListBox1.Items.Add('Elapsed time (nn:ss:zz): ' + FormatDateTime('nn:ss:zz', stop - start));
end;
The TDateTimes and ListBox are only to illustrate the problem. I should add that the 64 bit library path looks at C:\Program Files (x86)\FastReports\LibD22x64, whereas the 32 bit path is C:\Program Files (x86)\FastReports\LibD22.
Regards, Peter