"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Thomas Adam <thomas@xteddy.org>
Subject:
Re: small got-read-pack performance improvement
To:
gameoftrees@openbsd.org
Date:
Mon, 23 Feb 2026 17:54:10 +0000

Download raw body.

Thread
On Mon, Feb 23, 2026 at 04:54:30PM +0100, Stefan Sperling wrote:
> While enumerating trees, got-read-pack is doing a no-op malloc/free dance
> per tree entry if we have already traversed the entry.
> This can be costly when we already have a lot of memory allocated because
> malloc and free tend to become slower when lots of allocations exist.
> 
> This match changes the cost to memcpy instead. I have more ideas about
> how to improve this to avoid mempcy. But we can start with this.
> 
> ok?

Seems fine to me.

One observation though is that we keep defining MINIMUM where needed rather
than centralising this.  I know why this is.  From a portability perspective,
it does make me itch.

Rest of this patch looking good to me, FWIW.

Kindly,
Thomas