On Mon, Aug 22, 2011 at 9:37 AM, Dimitrios Apostolou <ji...@gmx.net> wrote:
> free() was called way too often before, this patch reduces it significantly.
> Minor speed-up here too, I don't mention it individually since numbers are
> within noise margins.

As there is no re-use in this pool the natural allocator to use is an
obstack which has even less overhead than a alloc_pool.

Richard.

>
> 2011-08-22  Dimitrios Apostolou  <ji...@gmx.net>
>
>        * graphds.h (struct graph): Added edge_pool as a pool for
>        allocating edges.
>        * graphds.c (new_graph): Initialise edge_pool.
>        (add_edge): Allocate edge from edge_pool rather than with malloc.
>        (free_graph): Instead of iterating across the graph freeing edges,
>        just destroy the edge_pool.
>

Reply via email to