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

Responsive rustdoc output is unresponsive (literally) #22325

Closed
mahkoh opened this issue Feb 14, 2015 · 1 comment · Fixed by #22769
Closed

Responsive rustdoc output is unresponsive (literally) #22325

mahkoh opened this issue Feb 14, 2015 · 1 comment · Fixed by #22769
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@mahkoh
Copy link
Contributor

mahkoh commented Feb 14, 2015

E.g. http://tomaka.github.io/cpal/alsa-sys/index.html

Resizing two windows that show this site causes 3-5 seconds of 100% cpu usage on two cores.

Solution: Remove responsive javascript to make the site more responsive.

    function resizeShortBlocks() {
        if (resizeTimeout) {
            clearTimeout(resizeTimeout);
        }
        resizeTimeout = setTimeout(function() {
            var contentWidth = $('.content').width();
            $('.docblock.short').width(function() {
                return contentWidth - 40 - $(this).prev().width();
            }).addClass('nowrap');
            $('.summary-column').width(function() {
                return contentWidth - 40 - $(this).prev().width();
            })
        }, 150);
    }
    resizeShortBlocks();
    $(window).on('resize', resizeShortBlocks);

But that's not all: When you load this site for the first time, it doesn't even react to any user input for 5 seconds.

@steveklabnik steveklabnik added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Feb 14, 2015
@retep998
Copy link
Member

Another example of this problem: https://retep998.github.io/doc/winapi/winerror/index.html

Manishearth added a commit to Manishearth/rust that referenced this issue Mar 11, 2015
Manishearth added a commit to Manishearth/rust that referenced this issue Mar 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants