[HarfBuzz] Avoiding python attribute lookups on .cluster, .codepoint, .x_advance, .x_offset, etc

Behdad Esfahbod behdad at behdad.org
Tue Aug 2 04:49:41 UTC 2016

Maybe this? https://github.com/ldo/harfpy

On Mon, Aug 1, 2016 at 11:25 AM, Kelvin Ma <kelvinsthirteen at gmail.com> wrote:
> So long ago I posted issue 287 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.
> I’ve already found the bottleneck in the code, the four attribute lookups in
> the unpacking function
> ((N.cluster, N.codepoint, P.x_advance, P.x_offset) for N, P in zip(infos,
> positions))
> .
> 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?
> _______________________________________________
> HarfBuzz mailing list
> HarfBuzz at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/harfbuzz


More information about the HarfBuzz mailing list