Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: FireDac slower on Delphi 10.2 after upgrade from Delphi XE8



Permlink Replies: 5 - Last Post: Jul 26, 2017 1:43 AM Last Post By: Robert Triest
Robert Triest

Posts: 687
Registered: 3/24/05
FireDac slower on Delphi 10.2 after upgrade from Delphi XE8
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 17, 2017 12:38 AM
I have one module that fetches records in a loop from a large datatable. After upgrading the application to Delphi Tokio 10.2 this module responded much slower than before the conversion. I had to drill down the sources to see where this speed problem lies. The source code of the application has not been changed and at the end I found the problem lies in fetching and adding records from/to a large datatable. (with proper indexes) The same procedure in Delphi XE8 is still ok for the user but in the new compiled application the user will notice this lack of speed while working with this module. The SQL that fetches the data is a simple select statement.

procedure THistoryObject.QryByKey(aKeyModule, aKey1, aKey2, aKey3: string);
var
  SQLText: string;
begin
  SQLText := 'select * from "History" WITH(NOLOCK)';
  SQLText := SQLText + ' where KeyModule=:KeyModule' + ' and Key1=:Key1 and Key2=:Key2 and Key3=:Key3 order by DateTime DESC';
 
  qryHistory.Active := False;
  qryHistory.SQL.Clear;
  qryHistory.SQL.Add(SQLText);
 
  qryHistory.ParamByName('KeyModule').AsString := aKeyModule;
  qryHistory.ParamByName('Key1').AsString := aKey1;
  qryHistory.ParamByName('Key2').AsString := aKey2;
  qryHistory.ParamByName('Key3').AsString := aKey3;
 
  qryHistory.Active := True;
  qryHistory.First;
end;


The question is if there are known issues with FireMonkey in the latest Delphi release? (Tokio 10.2)
I use the same MSSQL driver (native 11), the same database. The only difference is that I have compiled
the sources now on a new 64-bit machine. (The program is still a Win32 application)
So, I have two machines, one with Delphi XE8 and one with Delphi Tokio 10.2 with the same sources and
fetching records with the XE8 application is much quicker.
Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: FireDac slower on Delphi 10.2 after upgrade from Delphi XE8
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 17, 2017 9:41 PM   in response to: Robert Triest in response to: Robert Triest
You can do the following:
* create a simple test application calling in a loop your procedure
* enable FireDAC trace output for connection:
http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Tracing_and_Monitoring_(FireDAC)
* run application on both machines
* compare trace outputs or post them to attachments forum and I will review them

--
With best regards,
Dmitry
Robert Triest

Posts: 687
Registered: 3/24/05
Re: FireDac slower on Delphi 10.2 after upgrade from Delphi XE8
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 18, 2017 7:56 AM   in response to: Dmitry Arefiev in response to: Dmitry Arefiev
Dear Dmitry,

Thank you for your quick response.
I've added two trace files in the attachment forum ("FireDac Test fetching Records")
As you suggested I created a small application using my dataobject. It only fetches 50 records from the table.
I compiled the application with Delphi XE8 and with Delphi Tokio 10.2 and there is indeed a big difference between the two applications.
I hope you can help me out because this is a showstopper for my application upgrade to Delphi Tokio 10.2.

I wonder if there are default properties changed on FD-DataConnection or FD-DataQuery components since XE8.
Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: FireDac slower on Delphi 10.2 after upgrade from Delphi XE8
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 19, 2017 12:12 AM   in response to: Robert Triest in response to: Robert Triest
1) You made trace outputs too short. Anyway, that gave me idea.
2) I replied with the patch to your message in attachments forum.

--
With best regards,
Dmitry
Robert Triest

Posts: 687
Registered: 3/24/05
Re: FireDac slower on Delphi 10.2 after upgrade from Delphi XE8
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 19, 2017 1:35 AM   in response to: Dmitry Arefiev in response to: Dmitry Arefiev
Dmitry Arefiev,

The patch did not work.
I created longer FireDac Trace files and put it in the attachment forum. (FireDac Test fetching Records Part II)

Many Thanks.
Robert Triest

Posts: 687
Registered: 3/24/05
Re: FireDac slower on Delphi 10.2 after upgrade from Delphi XE8
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 26, 2017 1:41 AM   in response to: Dmitry Arefiev in response to: Dmitry Arefiev
Dmitry,

What is the best I can do now?

Was you able to look into the extended Trace files?
https://forums.embarcadero.com/thread.jspa?messageID=893373&#893373

Should I create an official issue report about this?

Thanks.

Edited by: Robert Triest on Jul 26, 2017 10:42 AM
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02