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

Slow javascript #192

Closed
urticadioica opened this issue Jan 14, 2017 · 2 comments · Fixed by #241
Closed

Slow javascript #192

urticadioica opened this issue Jan 14, 2017 · 2 comments · Fixed by #241
Labels

Comments

@urticadioica
Copy link
Collaborator

Since at least several months ago, some piece of javascript on vimgolf.com has been running slow on large challenge pages. I think I've found the problem: a call to .button() in application.js. Removing it on a local copy removes the issue.

This link suggests that initializing a button in jQuery involves an expensive DOM search every time it's triggered, so it causes problems on large pages.

Severity: On the largest pages, this problem causes up to a 30 second delay after $(document).ready triggers, after which I can't scroll. (That's on my modern-but-bargain-cheap laptop, running Firefox.) I get up to 3 "Stop script" dialogs during that time. For users who can't see all the solutions yet, it won't be quite so bad, but after they climb the leaderboard...

@igrigorik igrigorik added the web label Jan 14, 2017
@Hettomei
Copy link
Contributor

We can see it in chrome devtool ! so much time/cpu spent to have a "good looking" button :)

I let a comment here to remember to delete "application.js" that do nothing than adding some css on 2 buttons.

My smartphone crashed because of this. So I think it is a step to "make it more mobile friendly"

@igrigorik
Copy link
Owner

I'm all for removing those libraries in favor of vanilla CSS and JS markup. :)

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

Successfully merging a pull request may close this issue.

3 participants