Should you avoid jQuery and/or jQueryUI?

Go To StackoverFlow.com

0

The speed with these libraries results in the page blinking every time I reload it (which it doesn't do if I don't use them). I also think that a speed of more than 0.9 seconds is inacceptable when it is published on the internet. If this is the speed at the localhost with 0 meters of traveling distance from the server to the client, then I'm scared to think about the time it would take after being published.

Are jQuery and jQueryUI slow libraries that you should normally avoid if you don't really need them?

2012-04-03 22:43
by Friend of Kim
something must be wrong with configuration or something. Localhost should not take more than a couple of milliseconds. Even if there is MySQL behind it. (if there is, do some investigation on the queries). 0.5 seconds is way to slo - Rene Pot 2012-04-03 22:46
first, do you have code or a sample so we can inspect? maybe there are scripts conflicting, or your page is just loading too much resources over the wire. next, try using a locally hosted jQuery. sounds like you are using the ones on the net. also, try using the minified versions. jQuery doesn't take that long to load - Joseph 2012-04-03 22:46
Are you using minified versions (ending .min.js)? No, shouldn't avoid them normally, they'll ultimately make your life easier and your site more consistent for visitors - Adam 2012-04-03 22:47
Thanks for replies! I use the local minified versions. I restarted the computer and it was better now. Still not satisfied, though. - Friend of Kim 2012-04-03 22:59
Why is this question closed? It's quite specific and asks a reasonable question. Of course loading additional resources that require seperate HTTP requests will slow down a page, doesn't anyone have a genuine solution - RobG 2012-04-03 23:51
Looking back on my old questions (During the last year I've quadrupled my programming skills...) I remember that the real problem here was WAMPServer. There was a bug that made the server slow if IE was open. Multiple users has reported this, but if it was WAMPServer or the Apache build WAMPServer used at the time, I don't know - Friend of Kim 2013-09-05 21:13


0

Actually it depends on which JQuery library version you are using. The minified versions can speed up the web page. Also having them locally is a plus but you won't have the updated version (when you use a cdn you can have the latest).

What kind of external data do you load? Are they all using AJAX calls? What is your usual server connection?

These are the questions you should focus on.

2012-04-03 22:47
by Panagiotis
Thanks! Everything is as minified and local and as speed improved as possible - Friend of Kim 2012-04-03 23:02
I restarted the computer and got decent results, but not what I'm hoping for. - Friend of Kim 2012-04-03 23:02
If you use your computer as development server, then you won't get fast results. Your OS does also some works to have the browsers and all the other stuff you run while it takes processing time to use the webserver and any other server you got loaded - Panagiotis 2012-04-03 23:05
Ahh, thanks for your time and effort - Friend of Kim 2012-04-03 23:08
when you use a cdn you can have the latest — are you suggesting simply including new versions without testing? Good luck with that - RobG 2012-04-04 02:07
Mm, true. Both that and the fact that I'm dependent upon Google makes me host jQuery myself - Friend of Kim 2012-04-04 09:00


4

jQuery and jQuery-UI are not slow by definition.

Abuse of these might slow down the page though - Do you really need hundred shiny effects?

2012-04-03 22:45
by Rob W
+1 for "shiny" - Joseph 2012-04-03 22:48
Uhm, I don't overly use them. I just use the show(fold) instead of just show() or css("display", "block"). The page isn't meant for business people and alike, so my audience will like some movements - Friend of Kim 2012-04-03 23:01
You might want to check benchmarks before saying "jQuery and jQuery–UI are not slow". In IE at least, native browser methods are 2 to 3 times faster for a range of tasks. There are also results charts for a variety of browsers - RobG 2012-04-04 00:04
@RobG Using .show() instead of .css('display','block') does not lead to noticeable performance issues. jQuery will never outperform native JavaScript, because it's written in JavaScript. Not going to deep in detail, since there are already several "To jQuery or Not" Q&As on SO - Rob W 2012-04-04 08:50
I was commenting on the general statement, not specific cases. Implementing UI features like menus that slide open and closed, or "lightbox" effects that wait for the image to download, then fade in and out are slow by definition, regardless of how they are implemented - RobG 2012-04-04 08:53
@RobG That's not specific to jQuery-UI. Writing a cross-browser implementation of "shiny" effects, in (native) JavaScript (CSS transitions are not available in older browsers) is not more effective than using an existing, thoroughly tested library - Rob W 2012-04-04 10:27
Ads