On 14.08.2014 17:28, Dominik wrote:
Hi,
I have a code that accesses pmap.a for a PropertyMap pmap attached to vertex-filtered GraphView quite frequently. The function PropertyMap._get_data calls the GraphView constructor every time, simply to construct a non-filtered graph view from which it obtains e.g. the number of vertices for vertex properties.
Quite some time is spent in this constructor cumulatively, since it is called millions of times from _get_data in my case. It seems to me that there could be a simpler solution if the API is extended a bit.
See in graph.cc
Actually, all we might want to do, is to use SoftNumVertices despite working on a vertex-filtered graph, right? So, we don't need to construct a non-filtered graph. Is that correct? It could be kind of a "GetUnfilteredNumberOfVertices".
I have fixed this now in git: https://git.skewed.de/count0/graph-tool/commit/a49b19f3f94cc71919a4b2e685b0c... Best, Tiago -- Tiago de Paula Peixoto <tiago@skewed.de>