Thanks for the shout-out, but all the credit for the line-breaking in TeX goes to Knuth and Plass; I was just in the nearby vicinity, and like to make authoritative pronouncements. The linked comments do represent my accurate measurements of running the unadulterated TeX code from Knuth's hand on modern hardware.
I found this great overview of the algorithm which similarly addresses what your comment mentions about it being quadratic is a ‘commonly known fact’ by programmers but is not really true:
https://github.com/jaroslov/knuth-plass-thoughts/blob/master...
It’s always fascinating how these older algorithms and research is still highly relevant and it’s implementation being debated over.
As another datapoint, Knuth-Plass style line breaking is implemented on Android TextView and turned on by default, as of Marshmallow I think. There is a bit of a performance cost, but I personally never came across anybody who turned it off to gain more speed.
https://news.ycombinator.com/item?id=19785968
https://news.ycombinator.com/item?id=19473277