I am a user of koreader (an e-reader app) which utilizes libunibreak. I noticed it spends a lot of time (10%) in libunibreak during layout and rendering. It turns out, libunibreak uses a 2-level linear lookup for line break property. For most code points, it requires like dozens of comparisons.
Hi,
I am a user of koreader (an e-reader app) which utilizes libunibreak. I noticed it spends a lot of time (10%) in libunibreak during layout and rendering. It turns out, libunibreak uses a 2-level linear lookup for line break property. For most code points, it requires like dozens of comparisons.
I've made a test change here: https://github.com/bbshelper/libunibreak/commit/aee6dbc4d2d262709af92483f619316b40cd30db. With a lookup table for BMP and binary search for higher codepoints, it is 10x faster in tests on my PC.
Would you accept this kind of change? If so, I can polish the commit and make a pull request.