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

Remove the dependency on ouroboros #137

Merged
merged 1 commit into from
Jun 8, 2023
Merged

Conversation

bjorn3
Copy link
Contributor

@bjorn3 bjorn3 commented Jun 8, 2023

This reduces compilation time by removing a dependency on syn and other dependencies of ouroboros_macros. In addition it saves a lot of unused codegened methods.

On my laptop (2 core + HT) this reduces compilation time by ~20%. On a many core system this doesn't help much though as the critical path path consists of both ttf-parser -> rustybuzz and swash. Further gains will likely need to be made by reducing compilation time for these crates.

# main
Benchmark 1: cargo build
  Time (mean ± σ):     25.150 s ±  0.167 s    [User: 84.414 s, System: 7.335 s]
  Range (min … max):   24.909 s … 25.444 s    10 runs

# this PR
Benchmark 1: cargo build
  Time (mean ± σ):     19.819 s ±  0.226 s    [User: 67.754 s, System: 5.592 s]
  Range (min … max):   19.492 s … 20.140 s    10 runs

The code is based on an expansion of the ouroboros macro, cleaned up to remove all unused methods and inline most functions that are only called once.

This reduces compilation time by removing a dependency on syn and other
dependencies of ouroboros_macros. In addition it saves a lot of unused
codegened methods.

On my laptop (2 core + HT) this reduces compilation time by ~20%. On a
many core system this doesn't help much though as the critical path path
consists of both ttf-parser -> rustybuzz and swash. Further gains will
likely need to be made by reducing compilation time for these crates.

Benchmark 1: cargo build
  Time (mean ± σ):     25.150 s ±  0.167 s    [User: 84.414 s, System: 7.335 s]
  Range (min … max):   24.909 s … 25.444 s    10 runs

Benchmark 1: cargo build
  Time (mean ± σ):     19.819 s ±  0.226 s    [User: 67.754 s, System: 5.592 s]
  Range (min … max):   19.492 s … 20.140 s    10 runs

The code is based on an expansion of the ouroboros macro, cleaned up to
remove all unused methods and inline most functions that are only called
once.
@bjorn3
Copy link
Contributor Author

bjorn3 commented Jun 8, 2023

axelf4/unicode-linebreak#8 by @NobodyXu also helps with compilation time.

@bjorn3
Copy link
Contributor Author

bjorn3 commented Jun 8, 2023

Looks like there may be an easy win for swash: dfrg/swash#37 (comment)

@jackpot51 jackpot51 merged commit b7f2687 into pop-os:main Jun 8, 2023
@bjorn3 bjorn3 deleted the no_ouroboros branch June 8, 2023 18:39
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