Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Further Speed Optimisation #21

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Further Speed Optimisation #21

wants to merge 3 commits into from

Conversation

vzwick
Copy link

@vzwick vzwick commented Jan 29, 2012

By pre-caching of $(settings.container) and default_container flag

Valentin Zwick added 2 commits January 30, 2012 00:29
By pre-caching of $(settings.container) and default_container flag
By pre-caching of $(settings.container) and default_container flag
@vzwick
Copy link
Author

vzwick commented Jan 29, 2012

The pre-caching should make things significantly faster when using a custom container.

@tuupola
Copy link
Owner

tuupola commented Feb 10, 2012

Thanks. Will merge during weekend.

@tuupola
Copy link
Owner

tuupola commented Feb 25, 2012

Merged half of this. Thanks! Will keep pull request open to remind myself to merge rest of it after I do some internal changes.

… should avoid using jQuery proprietary selector extensions for performance reasons (thus enabling the use of native selector implementations by jQuery in the background) and use `filter()` instead.
@vzwick
Copy link
Author

vzwick commented Mar 21, 2012

Err. Disregard the update, please.

@regisf
Copy link

regisf commented Aug 13, 2012

New update function to improve speed. It's not the jquery way of life, but it's faster. The loop is descending because JIT compiled scripts run faster. Works on FF, Chrome. Not tested with IE.

    function update() {
        var counter = 0;
        for(var i=elements.length - 1; i >= 0; i--) {
            var el = elements[i], $this = $(el);
            if ($this.data('ll_loaded') === true) {
                continue;
            } else if (settings.skip_invisible && !$this.is(':visible')) {
                continue;
            } else if (!$.belowthefold(el, settings) && !$.rightoffold(el, settings)) {
                    $this.trigger("appear");
                    $this.data('ll_loaded', true);
            } else {
                if (++counter > settings.failure_limit) { // Don't know what to do here but it's work.
                    //break;
                    continue
                }
            }
        }
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants