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

Performance issues for pageload #761

Closed
chr22 opened this issue Sep 7, 2015 · 6 comments
Closed

Performance issues for pageload #761

chr22 opened this issue Sep 7, 2015 · 6 comments

Comments

@chr22
Copy link

chr22 commented Sep 7, 2015

With the following languages loaded, is the performance very bad for the critical pageload time on mobile, here a Nexus 4 running Chrome. 4.3 seconds are added to the page load time. This example is on a page with no highlighting.

mobile

With a fewer number of languages the performance is better, but the page still takes more than 500ms longer to load, on a page with no highlighting.

mobile2

@Golmote
Copy link
Contributor

Golmote commented Sep 7, 2015

Don't have any Nexus to investigate this. But if you're concerned with the performance, you should probably consider loading Prism asynchronously and running the highlighting by yourself.

@chr22
Copy link
Author

chr22 commented Sep 8, 2015

The problem isn't specific to the Nexus, it is devices with slow CPUs (all smartphones and tablets), because you have so much initialization that are very CPU heavy. But i hear you, you don't want to change that (which is fair), so i will play with som async loading, or change framework.

@Golmote
Copy link
Contributor

Golmote commented Sep 8, 2015

Don't get me wrong: you are very welcome to suggest any optimisation you think could improve the performance on such devices. You are also welcome to point at some specific CPU heavy initialization you think could be improved.
But with only those screenshots, there is nothing I can do.

@siemiatj
Copy link

Not sure if that helps in your case but I've rewritten the tokenizing part of prism as it was too slow and unstable with large files : https://github.com/siemiatj/prism-lite . It comes with some drawbacks but maybe this won't be a problem for you.

@LeaVerou
Copy link
Member

Hey there, thanks for working on Prism!
Why don’t you submit a PR so we can actually have a diff of the changes? Also, explaining your changes and what drawbacks they entail would help.

@Golmote
Copy link
Contributor

Golmote commented Dec 5, 2017

Without any more specific information, I'm afraid there is nothing we can do about this. I'm closing the issue.

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

No branches or pull requests

4 participants