http://delivery.acm.org/10.1145/1610000/1600217/p99-hurst.pd...
Knuth-Plass takes O(kn) where n is the number of words and k the number of words per line. That’s definitely slower than the naive line-by-line method.
But the better algorithm can be supposedly improved with the method in this paper (I haven’t read it and don’t have time just now, so I’m not sure how much slower it would then be than the naive way).
http://delivery.acm.org/10.1145/150000/146656/p546-eppstein....