<div dir="ltr"><div><span style="font-family:arial,helvetica,sans-serif">So long ago I posted issue <a href="https://github.com/behdad/harfbuzz/issues/287">287</a> on the harfbuzz issue tracker and I got no response, but the problem remains, using harfbuzz with python is inordinately slow. My application only performs smoothly when run on high-end hardware, otherwise performance is borderline-to-sluggish.<br><br></span></div><span style="font-family:arial,helvetica,sans-serif">I’ve already found the bottleneck in the code, the four attribute lookups in the unpacking function <br></span><pre><span style="font-family:arial,helvetica,sans-serif"><code>((N.cluster, N.codepoint, P.x_advance, P.x_offset) for N, P in zip(infos, positions))<br></code></span></pre><pre><span style="font-family:arial,helvetica,sans-serif"><code><span style="font-family:arial,helvetica,sans-serif">. <br>Preferably this would get bypassed in the C–Python bindings, so that the lookup would occur in C, where it would be much, much faster than Python’s dynamic lookup. But if this isn’t going to happen any time soon, what would be the best way to add some C helper functions in my app to get these lookups out of the way?</span><br></code></span></pre></div>