Call Center - Slow Application Launch

Call Center - Slow Application Launch

Postby metro » Fri Jun 20, 2014 7:04 pm

Slow Application Launch

When I start my application for the first time after booting the computer (W7 and Linux-Wine) or just reboot the machine, the application needs about 1 to 2 minutes to show the first dialog (main application screen).
After then, at each subsequent application start, the first dialog (main application screen) is shown in about 5-6 seconds.

On the main application dialog, there are several folders/tabs (about 12). Each folder/tab contains 10-15 buttons.

I have an impression that working with many folders/tabs is quite slow.
My machine contains i7 processor and a lot of memory so I would say it is not the processor/memory problem.
The same problem on pure W7 machine and on Linux/Wine combination

Anyone have an experience with slow running applications which uses folders/tabs?
Any suggestion appreciated
Thanks

[IMG=http://www.image-share.com/upload/2597/232m.jpg]

xHB 2011E , FWH_10.5
metro
 
Posts: 18
Joined: Tue Sep 25, 2012 6:01 pm
Location: Croatia

Re: Call Center - Slow Application Launch

Postby Antonio Linares » Fri Jun 20, 2014 7:48 pm

Dubrabko,

Maybe your app manages too much controls, but that should not affect that much.

You are using old xHB and FWH versions. I would suggest to upgrade and use the most recent code, and please consider to migrate to Harbour as that could make an important difference.

Harbour has greatly improved along these years. All of you should realize that using an old version of xHarbour/Harbour does not help you at all. A lot of work has been done on Harbour (and on FWH) and the current version (3.2) works really fine.

I can't say for sure that is the reason of the slowness that you comment, but for sure, you should notice a difference if you use the most recent Harbour and FWH.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Call Center - Slow Application Launch

Postby Antonio Linares » Fri Jun 20, 2014 7:50 pm

Slowness is directly related to the memory management, and Harbour has improved so much on that area.

Maybe there are other factors too that we may review. But lets first discard that the problem does not come from using those old versions. Thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Call Center - Slow Application Launch

Postby Rick Lipkin » Fri Jun 20, 2014 7:54 pm

Metro

Looks like a nice app .. what back end database are you using .dbf or Ado?

Rick Lipkin
User avatar
Rick Lipkin
 
Posts: 2616
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Call Center - Slow Application Launch

Postby metro » Fri Jun 20, 2014 8:38 pm

Antonio, Rick

Thanks for the quick reply.

Application when starting, really works well and quickly

Yeah, I'm thinking about crossing the Harbour, but I'm not sure I have a good solution for working with MySQL database!

The first version, works with a PgSQL - (Xbase language) which proved to be slow and unstable. (50 USER, 2 million records). The problem was to work with indexes. So I switched to natural SQL without Xbase language.



The second version works with MySQL database and xHarbour use for connection to the database and everything else is the SQL syntax (nErr = osql: exec (cSql, ...))
metro
 
Posts: 18
Joined: Tue Sep 25, 2012 6:01 pm
Location: Croatia

Re: Call Center - Slow Application Launch

Postby nageswaragunupudi » Sat Jun 21, 2014 2:22 am

Sharing my experiences:

This has nothing to do with FWH, xHb/xHarbour/Harbour. Whatever we use the result will not be much different.

Initially sometime is taken to establish connection with the remote server, opening some tables and reading some data necessary to start the initial main window. It is here the delay occurs and we need to optimize this part. This time mostly depends on the connection speeds, the amount of data we read. We should be *extremely* cautious when dealing with huge tables. When opening very large tables, never to open without where clause so that only a small subset is read.

We need to measure the time it takes from "function Main()" till "ACTIVATE WINDOW/DIALOG". This is the time we need to optimize and this has nothing to do with fwh or (x)Harbour. This may depend on what library we are using to communicate with the Sql server and what are we doing initially (what tables we are opening and reading).

Even after the best optimization, this process does take a few seconds, and even that delay is not acceptable for good user experience. In such cases we can adopt one the following strategies suitable to our application.

1. Display a progress message while doing the initial setup. Or display a logo and in the background do the initial setup.

2. Display the main window without data and display progress messase while doing the initial setup.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Call Center - Slow Application Launch

Postby Antonio Linares » Sat Jun 21, 2014 5:21 am

Yes, I agree with Rao. What he explains makes perfect sense and I missed to consider it :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Call Center - Slow Application Launch

Postby metro » Sat Jun 21, 2014 9:41 am

Rao,

Thank you for your experience

I will describe the flow of the program:
Code: Select all  Expand view

/ / ----------------------------
Function Main ()
   InitSys ()
   DefTableName ()          
   if TestConecction ()    
       if SysLogin ()
            MainApp ()
       endif
   else
      / / Msg
   endif
   Return
   / / ----------------------------
   MainApp function ()
       DEFINE WINDOW oWndCRM

          SET MESSAGE OF oWndCRM TO cMesage  //x --------------->  With this message I am presenting the message of progress

       ACTIVATE WINDOW ON oWndCRM DefDlg INIT ()
   Return
   / / ----------------------------
   DefDlg function ()

   DEFINE DIALOG oDlg RESOURCE "PHONENEW_WIDE"

       REDEFINE FOLDER oFld ID xxx OF oDlg
            // x ------------------------------> Here's delay
       Def_Fold1 ()
            // x ------------------------------> or here

       Def_Fold1 ()
             //x ------------------------------> or here
       //...

       Def_Fold16 ()


   ACTIVATE DIALOG oDlg
   Return
   / / ----------------------------
 


The delay is always at forming Folder!

In the first version (PgSQL) I used (xHarbour) and accessing the tables on Xbase way. As dbf-bases (So-open, seek, append, reclock, ....) And then that happened, just what you are suggesting. Very slow and unstable.

In the second version (MySQL) using xHarbour exclusively for connection to the server (localhost, network, remout-SSH). manipulation of data across functions nErr = osql: exec (cSql, ...), where cSql pure SQL syntax. I work exclusively with the array. It works very fast and stable.


I think it is well settled with the notification:
SET MESSAGE OF oWndCRM TO cMesage


Best regards
metro
 
Posts: 18
Joined: Tue Sep 25, 2012 6:01 pm
Location: Croatia

Re: Call Center - Slow Application Launch

Postby metro » Sat Jun 21, 2014 9:48 am

Initial setap is completely finished, and the connection to the database until it comes to SysLogin() functions .

[IMG=http://www.image-share.com/upload/2598/179m.jpg]

2-Display the main window without data and display progress messase while doing the initial setup.

The main window is formed without data. I just checked the log-in username / password.
metro
 
Posts: 18
Joined: Tue Sep 25, 2012 6:01 pm
Location: Croatia

Re: Call Center - Slow Application Launch

Postby Antonio Linares » Sat Jun 21, 2014 1:08 pm

Dubrabko,

A possible solution is not to redefine all the controls in all the folder pages at the same time:

1. Just build the first page (the one that it is visible).

2. When a different folder tab is clicked, then you could check if it has been defined such folder tab (use a static variable or so to control it, or check if oFld:aDialogs[ x ] length is zero) and then redefine it.

This way you don't build everything at once.

I have not tested it myself, but it should work. Please try it and if you get troubles, then I will explain you an alternative way to redefine the controls in each tab (the idea would be to use Class TFolder METHOD LoadPages( aResNames, bRedefineControls ))
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Call Center - Slow Application Launch

Postby metro » Sun Jun 22, 2014 7:14 pm

Antonio,

I created only one folder, but the problem is about the same.
After reset the computer, the first time delay 4 min and every next start almost immediately.

[IMG=http://www.image-share.com/upload/2600/42m.jpg]

Best regards
Dubravko Basic
metro
 
Posts: 18
Joined: Tue Sep 25, 2012 6:01 pm
Location: Croatia

Re: Call Center - Slow Application Launch

Postby nageswaragunupudi » Sun Jun 22, 2014 7:46 pm

metro wrote:Antonio,

I created only one folder, but the problem is about the same.
After reset the computer, the first time delay 4 min and every next start almost immediately.

[IMG=http://www.image-share.com/upload/2600/42m.jpg]

Best regards
Dubravko Basic

You are showing some data in the browse box on left.
How are you reading the data? From what table? What is your Sql?
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Call Center - Slow Application Launch

Postby metro » Sun Jun 22, 2014 10:23 pm

Rao,

The system works with a MySQL database.

There are several modes of operation.
1 - Free Mode
The agent logs on to the system and gain FrontEnd
[IMG=http://www.image-share.com/upload/2600/81m.jpg]


From the admin gets the task (Combobox - contry, Conty, Town addres ... etc). Once selected, press the button Refresh. The program is only now reads data from a table and displays the brows.

2 - Job Mode
Agent when logging select job that will work.
[IMG=http://www.image-share.com/upload/2600/80m.jpg]

Applications, before forming folder prepare array data (arraj variable is public). By measuring I found that it takes a very short time.
After logging gain FrontEnd:
[IMG=http://www.image-share.com/upload/2600/42m.jpg]


The problem exists in both modes of operation.

This is the SQL query - Mode 1

cComm: = "SELECT salutation, first_name, last_name, title,
account_name,email1,primary_address_street,primary_address_city,primary_address_postalcode,id,phone_home,phone_mobile,phone_work,phone_other "+;
"FROM" + cLeads + "" +;
"WHERE" cWhereQ + + "" +;
"ASC"

Best regards
Dubravko Basic
metro
 
Posts: 18
Joined: Tue Sep 25, 2012 6:01 pm
Location: Croatia

Re: Call Center - Slow Application Launch

Postby nageswaragunupudi » Sun Jun 22, 2014 11:31 pm

I see that all the time taken is for reading data from the tables.
You need to optimize this area.
Keep aside all windows and dialogs and folders.
Just write small code to read the data and optimize on the speeds. After that you incorporate the windows/folders, etc.

One hint: There will never be any major delays with fwh/(x)Harbour. Any major delay is only due to time taken to read data.

I guess you are dealing with very large files. You need to work on optimizing your queries. In particular it is a technique to optimize where clauses if we are dealing with large tables. Much depends on creating right indexes and usages of the indexed fields in our where clauses.

For example, if the where clause is "WHERE DEPT = 10", the query is damn slow if there is no index on DEPT.

By the way we do not know what are you using to connect to MySql server. Are you using ADO or TMySql or TDolphin?
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Call Center - Slow Application Launch

Postby metro » Mon Jun 23, 2014 7:02 am

Rao,

Thanks for your reply

1) I see that all the time is taken for reading data from the tables.
You need to optimize this area.

The data is read into an array and what you see in the picture is the brows array. Not all the time.

2) Keep aside all windows and dialogs and folders.
Just write small code to read the data and optimize on the speeds. After that you incorporate the windows / folders, etc..

Exactly read data

3) One hint: There will never be any major delays with FWH / (x) Harbour. Any major delay is only due to time taken to read the data.
No. MySQL has a very good set Index. Speed ​​data retrieval is measured and it is very good.

4) I guess you are dealing with very large files. You need to work on optimizing your queries. In particular it is a technique to optimize where clauses if we are dealing with large tables. Much depends on creating right indexes and usages of the indexed fields in our where clauses.
For example, if the where clause is "WHERE DEPT = 10", the query is damn slow if there is no index on DEPT.


Yes. The database is very large. I have optimized the MySQL server to work with large data.

5) By the way we do not know what are you using to connect to MySQL server. Are you using ADO or TMySql or TDolphin?

I use xHarbour SQL RDD. Connection of the base can be seen:
http://forums.fivetechsupport.com/viewtopic.php?f=3&t=25346&p=139607&hilit=ssh%20#p138353

I mentioned, I'm on line at the base constantly, but the data read (or insert, update)
when we need to. Browse array only, not the database (table).

The problem is that after a reset or when the computer is turned on, the formation of the app is about 4 minutes, and all other activation apps are fast!

Does the problem would be to cache or something?


Best regards
D. Basic
metro
 
Posts: 18
Joined: Tue Sep 25, 2012 6:01 pm
Location: Croatia

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Rick Lipkin and 107 guests