Skip to content

Profile and optimize slow GraphML export in tsumugi build-graphml #163

@akikuno

Description

@akikuno

📋 Description

The GraphML export in TSUMUGI is slow.

tsumugi build-graphml takes too long to finish, and the bottleneck may be in the GraphML writing step.

Problem

  • The execution time of tsumugi build-graphml is too long.
  • graphml_builder.py should be profiled to identify the bottleneck.
  • networkx.write_graphml may be the main cause of the slowdown.

Proposed actions

  1. Profile the execution speed of graphml_builder.py

    • Measure total runtime
    • Identify the slowest functions/steps
    • Confirm whether GraphML serialization/writing is the bottleneck
  2. Evaluate networkx.write_graphml

    • Verify how much time is spent in networkx.write_graphml
    • Check whether performance degrades with larger graphs
  3. Consider replacing the backend if needed

    • If networkx.write_graphml is confirmed to be too slow, consider replacing NetworkX-based GraphML export with a faster implementation (e.g., rustworkx)

Expected outcome

  • Clear identification of the performance bottleneck in GraphML export
  • A concrete optimization plan (code-level improvements and/or backend replacement)
  • Improved runtime for tsumugi build-graphml

🔖 TSUMUGI Version

No response

📎 Anything else?

Thanks @kinari-labwork for reporting the issue!

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions