Bug Tracker

Opened 12 years ago

Closed 11 years ago

#2972 closed enhancement (wontfix)

curCSS Really slow

Reported by: malfist Owned by:
Priority: minor Milestone: 1.3
Component: core Version: 1.2.5
Keywords: optimization Cc:
Blocked by: Blocking:

Description

I was running firebug's profiler over my webapp and found that the function using the most processor time (although it does not have the longest execution time) is curCSS. I dug around in the source code of Jquery and found it. It's a helper method and it plays with the DOM, the slowest part of javascript. Considering most good programmers don't need this (they do it already), it's redundant and a pointless waste.

Could this be changed to an opt-in function instead of a default?

Attachments (1)

profile.pdf (59.0 KB) - added by malfist 12 years ago.
The profile log.

Download all attachments as: .zip

Change History (4)

Changed 12 years ago by malfist

Attachment: profile.pdf added

The profile log.

comment:1 Changed 12 years ago by flesler

curCSS is used a LOT all over the source. It's not just the external use, it's widely used internally for dimensions, animations, offset, etc. And it cannot be optional... it's totally necessary.

comment:2 Changed 12 years ago by malfist

I commented out it's entire contents and had no adverse effects. I gained considerable increase in responce time.

comment:3 Changed 11 years ago by flesler

Resolution: wontfix
Status: newclosed

Well.. I was curious about this, commented all the function and ran the test suite.

100 tests of 1134 failed.

They belong to fx, dimensions, css, width/height and a few more single tests.

This shows that the function isn't used everywhere, but only by certain modules. You probably don't use them so it doesn't fail (or maybe it does fail and you don't notice).

Anyway.. all the mentioned modules are included into the core, and need to be supported.

You can always make your own build of jQuery, removing w/e you prefer.

Thanks

Note: See TracTickets for help on using tickets.