Hi,
I am trying to give our application a performance boost for the ng client so I am checking the “client performance” functionality in servoy admin pages.
Most time consuming seems to be this method :
[attachment=0]Schermafbeelding 2017-11-20 om 22.03.14.png[/attachment]
Is it correct to interpret that it takes avg 1,226 seconds to execute 1 api call “servoydefault-textfield.getWidth” ?
If yes, why is it that high ?
Can I conclude that my actual code takes 43,014 - 36,658 = 6,356 seconds and the rest of the time is consumed by the api calls for servoydefaults?
Thanks
Robrecht
EDIT
When debugging our own components we see that the acutal callback to servoy is taking most of the time.
Is there an explanation for that?
Yes, you are correct. But also see the max/min times. So max time when calling that to the browser is 8,047 sec. Min time is 0,5 sec.
On the label.getWidth (which basically does the same thing) you have average 0,81 sec with max 5 sec and min 0,031 sec.
At first glance it seems that it depends on the network connection. You had at least one client with bad connection - which had those high values of 8 and 5 sec and some fast client connections that were faster. The average is much affected by the max values because the number of times it got called is low (20 calls out of which 18 did sync client-side api calls).
That call is sent to client, processed there (should be fast inside the browser) and sent back. For example if the one with 0,5 sec would have 240ms network latency then that would be where most of the time was spent.
Try to avoid client-side calls that wait for a return value as much as possible. That is why the gray columns were added - to shed a light on these calls.
Btw in list/tableview it might need to scroll on client to the selected record before executing the API call which could mean in worst-case-scenario also the need to load some data on client (if the data is not yet loaded where it needs to scroll to) - so in such scenarios it could take longer to execute the API call even on client (on top of the usual back-and-forth it could trigger and wait for more data loading from the server + ui updates on browser). But for simple fields the API call itself - ignoring the network times - should be fast.
You are correct about the “43,014 - 36,658 = 6,356 seconds” assesment.
What do you mean with “the acutal callback to servoy”?
Hi Andrei,
It sounds reasonable that this is caused by a bad connection, but this was my local servoy developer environment so network shouldn’t be an issue.
What I mean with my previous remark regarding debugging our own components:
When executing following server code we can debug the client side code and the response is given almost instantly and no more client code is being executed
But this one line of code lasts a few seconds…
So the client has its response already but it takes a lot of time for servoy to get this actual response.
// 'datacontrol' is our custom webcomponent, having a client side api "getIndexById"
var index = elements.datacontrol.getIndexById(3')
Any other ideas on this?
Thanks
Robrecht
Yes what I also said earlier - the actual execution of the API call can be very fast and the rest of the time is network times.
But in your case - local server that should not be an issue. I assume you don’t have any slow network simulators active
.
Can you create a small sample with what you see? I want to try it out. I can’t believe that on localhost it can take seconds to execute an API call that in browser is almost instant. If there is a bug we should find it.
In a small sample solution I don’t get this beviour ![Rolling Eyes :roll:]()
Will update you later on
Thanks