[HarfBuzz] How fast is hb_buffer_create?

Behdad Esfahbod behdad at behdad.org
Thu Oct 3 07:07:06 PDT 2013


On 13-10-03 07:53 AM, Eduardo Castineyra wrote:
> Hi,
> 
> I'm wondering if it is better to create/destroy a buffer every time I have to
> do shaping or to reuse the same buffer and reset it.

hb_buffer_create() is pretty fast.  The main advantage of keeping one around
is the the buffers an hb_buffer_t allocates (and grows as you put longer text
into it) will be reused, as opposed to being freed and allocated small and
grown larger again.

One way or another shouldn't make any measurable difference to you.

-- 
behdad
http://behdad.org/



More information about the HarfBuzz mailing list