Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • graph-tool graph-tool
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 46
    • Issues 46
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

Please use the issue tracker only to report bugs (i.e. errors in the library that need to be fixed) or feature requests.

For questions about how to compile, install or use the library, please use instead the mailing list at https://graph-tool.skewed.de/mailing
(If unsure, use the mailing list first.)



When opening new issues, please choose the BUG template from the drop-down menu, and fill out the required information.

  • Tiago Peixoto
  • graph-toolgraph-tool
  • Issues
  • #197

Closed
Open
Created Dec 19, 2014 by Maximilien Cuony@theglu

Faster vertex()

Hello,

I was adding a lot of edges on one of my graph, using vertex() to get vertices and my code was kind of slow.

I did some benchmarking and found that a lot of time was spent inside the vertex() function (used by my code and add_edge()), especialy by calling get_vertex_filter and set_vertex_filter.

Since I wasen't using any filter, I just simplfied vertex() to

def vertex(self, i, use_index=True):
    return libcore.get_vertex(weakref.ref(self), int(i))

This is an ugly hack, but I got x4 speedup.

Would be possible to add an option to disable any *_vertex_filter call ? Eg. if the user didn't set a filter or with an option.

I can provide a merge request if needed :)

Assignee
Assign to
Time tracking