aplbrain / grand

Your favorite Python graph libraries, scalable and interoperable. Graph databases in memory, and familiar graph APIs for cloud databases.
Apache License 2.0
80 stars 6 forks source link

Add fast backend short-circuit for len(edges) #42

Closed j6k4m8 closed 4 months ago

j6k4m8 commented 1 year ago

Right now it's very slow to get the count of edges for certain backends. Adding a query for this directly (rather than requiring enumeration of all edges) would make some functions (such as nx.density) MUCH faster.

j6k4m8 commented 4 months ago

49