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 clean debug build speeds 25% by changing unicode-linebreak to xi-unicode #2

Closed
kettle11 opened this issue Oct 23, 2022 · 3 comments

Comments

@kettle11
Copy link
Contributor

kettle11 commented Oct 23, 2022

Hi! I'm quite excited for this library.

I'm a big fan of super lean build times so I try to audit dependencies to find areas to improve. In this case it seems unicode-linebreak implements a rather chunky build.rs script that makes it your second slowest building dependency (after swash).

xi-unicode pre-bakes the unicode tables without a build.rs so it builds much faster.

Swapping is an easy one-line change:

Change this line:

for (end_lb, _) in unicode_linebreak::linebreaks(span) {

to this:

for (end_lb, _) in xi_unicode::LineBreakIterator::new(span) {

Alongside the obvious cargo.toml changes.

Edit: I ran editor-test and it reported "All lines matched!". I haven't ran further tests.

@jackpot51
Copy link
Member

Thanks, I will look into this, would you want to make a PR?

@kettle11
Copy link
Contributor Author

@jackpot51
Copy link
Member

Merged!

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

2 participants