Boost logo

Boost Users :

Subject: Re: [Boost-users] [BGL] Very slow adjacency_list deallocation/reallocation for debug builds
From: Michael Fawcett (michael.fawcett_at_[hidden])
Date: 2010-02-23 15:11:45


On Tue, Feb 23, 2010 at 2:27 PM, T MacAdam <nsdevelop12_at_[hidden]> wrote:
> Does anyone know a way to speed up adjacency_list deallocation for debug
> builds?

The technique I use isn't documented, but it has been discussed before
on the list. It also uses implementation details so it's not
guaranteed to work across releases.

myGraph->m_vertices is the vector storing the vertices. Just call
reserve() on it when you know the number of vertices ahead of time.
If you want to do the same with edges use myGraph->m_edges, but you're
using a list for the edge storage so it doesn't apply to this case.

It would be nice if there was a way to reserve storage for vertices
and edges in the actual graph interface.

HTH,

--Michael Fawcett


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net