Welcome! Log In Create A New Profile

Advanced

[WM24] App is running incredibly slow

Posted by RobertLeo 
[WM24] App is running incredibly slow
October 30, 2019 08:50AM
I have deployed my app into a tablet to stress test it, and it takes a good 3-5 seconds to open a menu, and the app would come to a grinding halt for up to 30 seconds or more when it attempts to open combobox that contains a huge amount of records (about 12,000-ish), is there any way to optimize the loading speed? I am really at the end of my wits and I'd appreciate any help

Extra information: The database that contains the DB used by the app is stored in a cloud server
Re: [WM24] App is running incredibly slow
October 30, 2019 12:49PM
Hi,

If I were you, I'd take a look at the performance profiler as it may give you a clue of where to look...

[help.windev.com]

Regards,
Darren.
Re: [WM24] App is running incredibly slow
October 30, 2019 12:56PM
DarrenF Wrote:
-------------------------------------------------------
> Hi,
>
> If I were you, I'd take a look at the performance
> profiler as it may give you a clue of where to
> look...
>
> [help.windev.com]

yeah I know the cause already, and it is when calling the aforementioned records from the cloud that takes up the most time
Guest
Re: [WM24] App is running incredibly slow
October 30, 2019 02:51PM
Hi Robert,

I'm sorry to be the bearer of bad news, but your problem is directly linked to your architectural choices and has no solution if you leave the architecture as is...

You have TWO problems working together to make your app unusable:

1. you are loading 12000 lines in a combo.... NOBODY is ever going to scroll through and read 12000 lines to find the line they need.

>>>>Replace that by a search field and display ONLY the matching result.

2. you are trying to access your data on a remote server from a MOBILE application... This will not work at all if the app loses it's connection, and will be very slow if it does have a connection to the point of not being usable at all...

>>>>A mobile app should always work on a LOCAL DB... The best way to do that is to use a replication system. PCSoft does provide such a solution, but I'm personally partial to the WXReplication solution developed by Fabrice Harari (open source, so you can do whatever changes you need, and you can debug in case of problems). When I first started using it, he was very helpful for adapting he's solution to my specific needs, and I still use his services from time to time to implement improvements here and there.

Hope this help

Argus
Re: [WM24] App is running incredibly slow
October 31, 2019 03:53AM
Guest Wrote:
-------------------------------------------------------
> Hi Robert,
>
> I'm sorry to be the bearer of bad news, but your
> problem is directly linked to your architectural
> choices and has no solution if you leave the
> architecture as is...
>
> You have TWO problems working together to make
> your app unusable:
>
> 1. you are loading 12000 lines in a combo....
> NOBODY is ever going to scroll through and read
> 12000 lines to find the line they need.
>
> >>>>Replace that by a search field and display
> ONLY the matching result.
>
> 2. you are trying to access your data on a remote
> server from a MOBILE application... This will not
> work at all if the app loses it's connection, and
> will be very slow if it does have a connection to
> the point of not being usable at all...
>
> >>>>A mobile app should always work on a LOCAL
> DB... The best way to do that is to use a
> replication system. PCSoft does provide such a
> solution, but I'm personally partial to the
> WXReplication solution developed by Fabrice Harari
> (open source, so you can do whatever changes you
> need, and you can debug in case of problems). When
> I first started using it, he was very helpful for
> adapting he's solution to my specific needs, and I
> still use his services from time to time to
> implement improvements here and there.
>
> Hope this help
>
> Argus

Hello Argus, thanks for the reply, you have brought up good points for me to consider

1. hmm, now that you mention it it does seem incredibly silly to make it a combo box, is there any tutorial on how to make a search field? Because I have searched on how to do this but no answer came up, and by search field do you mean when the user enters a phrase, there will be a list of items that are similar to the entered phrase appear below?

2. I was considering on shifting the records from cloud into the apk itself, but I am afraid that the size would bloat so I will try out WXReplication, but does it work for iOS now? Or should I use the windev version of replication for that?

Edit: Is this only an issue in HFSQL? Will it be a non issue if I shift the DB to an Oracle DB? Because I am afraid on what would happen once the application goes live with a projected userbase of 20 million and a daily transaction of 5 million records



Edited 3 time(s). Last edit at 10/31/2019 10:58AM by RobertLeo.
stefan.kern
Re: [WM24] App is running incredibly slow
October 31, 2019 12:09PM
> Edit: Is this only an issue in HFSQL? Will it be a
> non issue if I shift the DB to an Oracle DB?
> Because I am afraid on what would happen once the
> application goes live with a projected userbase of
> 20 million and a daily transaction of 5 million
> records

Hi Robert,

this issue is not related to HFSQL, it is related to the fact, that Internet Connections might be slow or break from time to time.
My opinion is that consuming a database by a mobile device is a very bad design, especially if your app will have a huge amount of users.

Next thing: opening a database port on a server which is accessable through Internet is a huge security risk.
You should use something like wx replication or use a webservice or something else.

Keep also in mind in EU there is the "General data protection Regulation".
I think an open port on a Server and direct Access to a database will fail in any GDPR Audit.


Regards


Stefan.
Re: [WM24] App is running incredibly slow
October 31, 2019 12:15PM
stefan.kern Wrote:
-------------------------------------------------------
> > Edit: Is this only an issue in HFSQL? Will it be
> a
> > non issue if I shift the DB to an Oracle DB?
> > Because I am afraid on what would happen once
> the
> > application goes live with a projected userbase
> of
> > 20 million and a daily transaction of 5 million
> > records
>
> Hi Robert,
>
> this issue is not related to HFSQL, it is related
> to the fact, that Internet Connections might be
> slow or break from time to time.
> My opinion is that consuming a database by a
> mobile device is a very bad design, especially if
> your app will have a huge amount of users.
>
> Next thing: opening a database port on a server
> which is accessable through Internet is a huge
> security risk.
> You should use something like wx replication or
> use a webservice or something else.
>
> Keep also in mind in EU there is the "General data
> protection Regulation".
> I think an open port on a Server and direct Access
> to a database will fail in any GDPR Audit.
>
>
> Regards
>
>
> Stefan.

Hello Stefan, thanks for the advice, and in all honesty I am at my wits' end in this because none of my team has experience in windev, or even any experience at all in that matter so I am not certain on how to do these things aside from the things I learned by trudging on
Re: [WM24] App is running incredibly slow
November 01, 2019 10:47AM
So I decided to remove the 12,000 records and opening that window no longer outright freezes the tablet anymore, but it seems that the app is still slow (just not as slow as before), are there any recommendations on what can be done to optimize the app even more? And is there any guides on how to use WXReplication? Because I can't seem to find the documentation anywhere on the website
Re: [WM24] App is running incredibly slow
November 01, 2019 11:31AM
Robert,

Use the online Help:
[help.windev.com]

Not used it myself, but I've heard good reports of Fabrice Harari's Open Source WXReplication offering:
[fabriceharari.com]

Regards,
Darren.
stefan.kern
Re: [WM24] App is running incredibly slow
November 04, 2019 09:54PM
RobertLeo Wrote:
-------------------------------------------------------
> So I decided to remove the 12,000 records and
> opening that window no longer outright freezes the
> tablet anymore, but it seems that the app is still
> slow (just not as slow as before), are there any
> recommendations on what can be done to optimize
> the app even more? And is there any guides on how
> to use WXReplication? Because I can't seem to find
> the documentation anywhere on the website


Hi Robert,

to optimize the app you Need to use a local database and a Kind of replication.
Fabrice Hararris solution is a big one, and as far as I know it does not support "insert into" and "update..." SQL Statements, which I use very often.

I use Soap webservices, which are pretty easy in wx, have a look at the help.
I am sure, if you Keep direct data acess you will never get a secure, stable and fast app.

Regards

Stefan.
Author:

Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: