0

My application was running fine with JQuery 1.7.2. After I upgraded to 3.4.1 it has become very very slow. When debugged with chrome performance tool observed while getting and setting visibility of dom it has slowed down. Attaching the profiler snapshot,in older jQuery it took 0.12 ms and in newer it took 0.48. As i have many such dom elements to be displayed the total page loading duration is 4 times than older jQuery.

enter image description here

enter image description here

In older jQuery I can see Sizzle.attr is overridden by jQuery.attr and it never goes to Sizzle attr function. But in new JQuery they have removed this overriding and always Sizzle attr is executed and takes more time. Is there a way to avoid this Sizzle function call? Is there any other way to achieve better performance in new JQuery while setting and getting display attr?

  • How do you set Display attr? – Thallius Sep 11 '20 at 20:45
  • using jQuery object attr function. After narrowing down further , observed that the call jQuery.find.attr( elem, name ) in jQuery attr function if I replace with elem.getAttribute(name) improves the page load much better. How to extend attr: function( elem, name, value ) of jQuery? – ratheesh t.v. Sep 14 '20 at 18:58
  • Why not use directly the CSS Attribute? Element.css(‚display‘, ‚none‘) – Thallius Sep 15 '20 at 05:49

0 Answers0