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

dumps/serialize_to_writer: insert BufWriter to speed up serialization #554

Merged

Conversation

lschuermann
Copy link
Contributor

By buffering bincode's output prior to compression, we can achieve a ~30x speedup of syntect in debug builds (such as used in cargo tests by default) on a single SyntaxSetBuilder::build() call. For Tock's license-checker 1 crate using syntect, this brings overall test times down from ~75s to 4s on an i7-1360P. This change does not affect release builds much, bringing an individual test down from 0.17 to 0.13 seconds.

By buffering bincode's output prior to compression, we can achieve a
~30x speedup of syntect in debug builds (such as used in `cargo test`s
by default) on a single `SyntaxSetBuilder::build()` call. For Tock's
`license-checker` [1] crate using `syntect`, this brings overall test
times down from ~75s to 4s on an i7-1360P. This change does not affect
release builds much, bringing an individual test down from 0.17 to
0.13 seconds.

[1]: https://github.com/tock/tock/tree/a109dd65fb269479ca4fa020af0a54da740eca28/tools/license-checker
Copy link
Collaborator

@Enselic Enselic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@Enselic Enselic merged commit 31bce65 into trishume:master Oct 21, 2024
4 checks passed
@lschuermann
Copy link
Contributor Author

@keith-hall @Enselic Thanks for the swift reviews! Funnily enough, it seems like this change has sped up syntect's own CI pipeline by 4-5x, hah!

@lschuermann lschuermann deleted the dev/serialize-to-writer-buffered branch October 21, 2024 03:54
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.

3 participants