AJAX seems to be very slow in Nette

Notice: This thread is very old.
netteman
Member | 125
+
0
-

Hi all

I went throught this tutorial https://doc.nette.org/…ication/ajax and the code works but it seems to be very slow. It takes almost 2 seconds before the content of the div changes. Is this the normal behaviour of Nette? I'm asking because I can get the same result with 3 lines of jQuery and it takes just a couple of milliseconds.

Thanks :)

Last edited by netteman (2016-06-09 21:09)

greeny
Member | 405
+
0
-

Did you tested that on production server? It's often not about Nette/AJAX/jQuery speed, but about your computer speed. I get often AJAX responses in about 3 seconds on my laptop, but after moving onto production server, I have response in less than 100ms

CZechBoY
Member | 3608
+
0
-

Is javascript slow or response? Look at network tab in developer tools in browser, then use javascript profiler.

David Grudl
Nette Core | 8218
+
+1
-

It seems like active xdebug.

netteman
Member | 125
+
0
-

greeny wrote:

Did you tested that on production server? It's often not about Nette/AJAX/jQuery speed, but about your computer speed. I get often AJAX responses in about 3 seconds on my laptop, but after moving onto production server, I have response in less than 100ms

I tested it today and the response on my production server is also under 100 ms. Should I worry that the server needs more time in comparison to ordinary jQuery? (or in other words that the website is approximately 15× less efficient than it could be?)

(My non-nette code on the production server needs 47 ms to update a row in database and 32 ms to select the row and change content of a div)

Last edited by netteman (2016-06-10 20:43)

netteman
Member | 125
+
0
-

CZechBoY wrote:

Is javascript slow or response? Look at network tab in developer tools in browser, then use javascript profiler.

Are you asking about this https://developer.mozilla.org/…work_Monitor#…

or this? https://developer.mozilla.org/…/Performance

netteman
Member | 125
+
0
-

David Grudl wrote:

It seems like active xdebug.

I tried https://stackoverflow.com/…sable-xdebug on my laptop but nothing has changed.

Last edited by netteman (2016-06-10 20:38)

CZechBoY
Member | 3608
+
0
-

@netteman both

netteman
Member | 125
+
0
-

CZechBoY wrote:

@netteman both

I hope this is the data you'd like to see ;-)

http://oi64.tinypic.com/t5gkfm.jpg

The performance printscreen is zoomed on javascript only
http://oi63.tinypic.com/t6s7x0.jpg

Jan Tvrdík
Nette guru | 2595
+
0
-

netteman wrote:

I tried https://stackoverflow.com/…sable-xdebug on my laptop but nothing has changed.

You need to remove the extension entirely, disabling xdebug does not remove the slowdown.

netteman
Member | 125
+
+1
-

Jan Tvrdík wrote:

netteman wrote:

I tried https://stackoverflow.com/…sable-xdebug on my laptop but nothing has changed.

You need to remove the extension entirely, disabling xdebug does not remove the slowdown.

I deleted the xdebug dll extension and the response is about 20% faster.

Beny02
Member | 1
+
0
-

Hi, it is possible to create catalog – page like these ones: https://zoptamo.com/…s-c-us-place or http://travelmob.com but especially in nette? If answer is yes: what is the easiest way to do it with this framework?

CZechBoY
Member | 3608
+
0
-

@Beny02 Nette is only framework so you have to do it on your own – so the easiest and only way is to create presenters, templates like everywhere else.