Re: [HACKERS] PATCH: two slab-like memory allocators - Mailing list pgsql-hackers

From Tomas Vondra
Subject Re: [HACKERS] PATCH: two slab-like memory allocators
Date
Msg-id b3b2245c-b37a-e1e5-ebc4-857c914bc747@2ndquadrant.com
Whole thread Raw
In response to Re: [HACKERS] PATCH: two slab-like memory allocators  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Responses Re: [HACKERS] PATCH: two slab-like memory allocators  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
Hi,

Attached is v9 of this patch series. This addresses most of the points 
raised in the review, namely:

1) change most 'debug' stuff to 'static inline' in memdebug.h

2) fixed and reworded a bunch of comments

3) get rid of the block-level bitmap tracking free chunks

Instead of the bitmap, I've used a simple singly-linked list, using 
int32 chunk indexes. Perhaps it could use the slist instead, but I'm not 
quite sure MAXALIGN is guaranteed to be greater than pointer.

In any case, this seems to be working reasonably well - it saves a bit 
of code (but also made some code slightly more complex). Also, it seems 
to be a tad faster than v8 - after repeating the same benchmark as 
before, I get these numbers:

                 master    slab-v8    slab-v9
     -----------------------------------------
       10000         50         28         25
       50000      17500        180        160
      100000     150000        380        330
      200000          ?        750        670

Although the results are quite noisy.

regards

-- 
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachment

pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: [HACKERS] Multivariate statistics and expression indexes
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Multivariate statistics and expression indexes