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

Improve performance by doing more work in the worker #778

Merged
merged 1 commit into from
Sep 24, 2015

Conversation

zeitgeist87
Copy link
Collaborator

Currently the worker tokenizes the code and then turns it into a
JSON string. This JSON string is sent back to the main thread as a
message and parsed. Then it is turned into a HTML string and
stored in the attribute env.highlightedCode.

These conversions into JSON are unnecessary, because we can create
the HTML string directly in the worker and send it as a message to
the main thread.

Signed-off-by: Andreas Rohner andreas.rohner@gmx.net

Currently the worker tokenizes the code and then turns it into a
JSON string. This JSON string is sent back to the main thread as a
message and parsed. Then it is turned into a HTML string and
stored in the attribute env.highlightedCode.

These conversions into JSON are unnecessary, because we can create
the HTML string directly in the worker and send it as a message to
the main thread.

Signed-off-by: Andreas Rohner <andreas.rohner@gmx.net>
@Golmote
Copy link
Contributor

Golmote commented Sep 24, 2015

Hi! Nice catch, indeed. Thanks for contributing!

Golmote added a commit that referenced this pull request Sep 24, 2015
Improve performance by doing more work in the worker
@Golmote Golmote merged commit 1316abc into PrismJS:gh-pages Sep 24, 2015
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.

2 participants