Andres Freund <andres@2ndquadrant.com> writes:
> Oh, I and Peter weren't talking about the pg_list.h stuff, it was about my
> 'embedded list' implementation which started this subthread. The
> pg_list.h/list.c stuff isn't problematic as far as I have seen in profiles;
> its checks are pretty simple so I do not find that surprising. We might want
> to disable it by default anyway.
> In my code the list checking stuff iterates over the complete list after
> modifications and checks that all prev/next pointers are correct so its linear
> in itself...
Well, so does list.c, so I'd expect the performance risks to be similar.
Possibly you're testing on longer lists than are typical in the backend.
regards, tom lane