Speedup for GMemChunks (Bug#169389)


I just created Bug#169389, which is a little patch to improve
performance of GMemChunks:

The attached patch, while retaining ABI/API, adds a configure option
(enabled by default) which enables the use of posix_memalign(), if
available on the system, by the memchunk code. This speeds up
G_ALLOC_AND_FREE memchunks; on my system, memchunks were outperformed
by glibc's malloc/free before applying the patch; after applying the
patch, memchunks are a faster. A simple benchmark is included in the

Note that this is only a first version of the patch, and it certainly
can be improved a bit stylistic-wise (e.g. reducing the number of

I think this is somewhat related to Bug#18653 (Add GFreeList,
deprecate GMemChunk); I think GMemChunks might still be useful, since
they allow the memory to eventually freed again.


Andreas Rottmann         | Rotty ICQ      | 118634484 ICQ | a rottmann gmx at
http://yi.org/rotty      | GnuPG Key: http://yi.org/rotty/gpg.asc
Fingerprint              | DFB4 4EB4 78A4 5EEE 6219  F228 F92F CFC5 01FD 5B62

Make free software, not war!

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]