Improved Red-black tree implementation

Joerg Sonnenberger joerg at bec.de
Mon May 22 23:11:10 UTC 2017


On Sun, May 14, 2017 at 07:02:20AM +0200, Jens Stimpfle wrote:
> the BSD tree.h Red-black tree implementation has a design issue in that
> it doesn't share code between generated instances. Each instanciated
> tree costs about 3K of machine code (on amd64). Making multiple
> instances means increased pressure on the instruction cache (often 64K
> these days).

NetBSD at least has created sys/rbtree.h and matching code in
src/common/lib/libc/gen/rb.c ages ago.

Joerg


More information about the freebsd-hackers mailing list