-
Notifications
You must be signed in to change notification settings - Fork 36
Add a tokenize worker to speed up code highlighting #928
Comments
Before Web Workers are officially supported, we would need something like @willdurand @bobsilverberg maybe we should try and wait until CRA 3.1 is released? What do you think? |
Sounds reasonable to me. |
I think waiting for CRA 3.1 would be wise, even though the current PR does not support TypeScript. I guess we'll workaround that if needed, though. I like this suggestion in the meantime: #402 (comment). I would even say that minified code is barely readable anyway, with or without syntax HL (I don't read minified code a lot but usually I find it more confusing when syntax HL is enabled). |
Good call on disabling highlighting on large files. I'll do that in #942 |
This is supported in |
Removing this from the project as we determined this is not something we want to do at this time. See #1411 (comment) |
This issue has been automatically marked as stale because it has not had recent activity. If you think this bug should stay open, please comment on the issue with further details. Thank you for your contributions. |
Tokenizing a file to highlight the code makes the file render slowly. See #402 for STR -- a minified diff like this is the most dramatic example.
I confirmed in benchmarks that the tokenizer is the main offender so it's worth our time to try switching to a worker model.
Specifically, while profiling a production build from d07fbc3 and loading the minified diff from #402,
tokenize()
accounts for 95% of the time, i.e. 7.32 seconds.The text was updated successfully, but these errors were encountered: