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

Immediatedly add word if it fits #13

Closed
mgeisler opened this issue Jan 16, 2017 · 0 comments
Closed

Immediatedly add word if it fits #13

mgeisler opened this issue Jan 16, 2017 · 0 comments

Comments

@mgeisler
Copy link
Owner

When a word fits on the current line, we don't need to compute all the possible splits. We can simply push it onto the line and continue with next word.

mgeisler added a commit that referenced this issue Jan 23, 2017
This cuts the running time by about half:

 name                   before ns/iter  after ns/iter  diff ns/iter   diff %
 hyphenation_lorem_100  4,282           1,485                -2,797  -65.32%
 hyphenation_lorem_200  8,073           2,740                -5,333  -66.06%
 hyphenation_lorem_400  16,647          5,399               -11,248  -67.57%
 hyphenation_lorem_800  37,622          11,741              -25,881  -68.79%
 lorem_100              2,004           881                  -1,123  -56.04%
 lorem_200              3,995           1,880                -2,115  -52.94%
 lorem_400              7,787           3,650                -4,137  -53.13%
 lorem_800              15,746          7,395                -8,351  -53.04%

Fixes #13.
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

1 participant