BeSite/jQuery.dotdotdot — pull request #27 by mrdziuban (2014-04-04 15:11:40+00:00)
Title: Performance fix: only watch visible elements for changes in width/height

In the setInterval function that is called when the option 'watch' is set to anything other than 'window', every element in the DOM was getting monitored for changes in width and height, which had a negative impact on performance, especially in Firefox. On a page with about 50 elements being monitored, CPU usage remained constant at 100%.

This branch filters the elements by those which are visible on the page before checking if the width or height has changed. On the same page, with 50 elements being monitored (30 of which were hidden most of the time), this change decreased CPU usage to 60%.