Hacker News new | past | comments | ask | show | jobs | submit login

I’m surprised Knuth-Plass was noticeable; it’s not greedy cheap, but it’s got to be a drop in the bucket compared to rasterization. Did y’all make sure to implement the O(n) version, or did you do the O(n^2) variant?



Well, it's O(nm) where m is the number of candidate breaks on the line. The amount of time spent Knuthing and Plassing is not too bad, but where it does hurt you is that you have to measure the substrings with potential hyphenation breaks. And even if rasterization is more costly, layout hurts because often you have to do lots of it in bulk, when materializing new content, where rasterizing usually scales with the number of pixels you have to draw. And in Android that basically has to happen on the UI thread (offloading it to an async thread is theoretically possible but a major pain).

I haven't been involved in day-to-day engineering on Android in 3 years though. Maybe of the current team will feel like chiming in.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: