Performance regression for graph methods
I've noticed significant performance degradation for some core graph methods (specifically copy_property()
, vertex()
, and edge()
) between v2.80 and v2.83.
Test setup:
g = gt.generation.circular_graph(100000, k=1, directed=True)
print("copy_property():", timeit.timeit("g.copy_property(g.vertex_index, value_type='int64_t')", globals=globals(), number=500))
print("vertex():", timeit.timeit("g.vertex(100)", globals=globals(), number=20000))
print("edge():", timeit.timeit("g.edge(100, 101)", globals=globals(), number=5000))
Timings (v2.80):
copy_property(): 0.1075136659992495
vertex(): 0.008619750000434578
edge(): 0.007551457999397826
Timings (v2.83): (NOTE: The slowdown is also present in current version (v2.88). v2.83 is the earliest version available on conda-forge where the slowdown was present)
copy_property(): 2.2333500419999837
vertex(): 3.2896682079999664
edge(): 2.4678019579996544