Skip to content

examples: benchmark of the key operations - #55

Merged
petercorke merged 4 commits into
mainfrom
feat/benchmark-example
Oct 12, 2026
Merged

petercorke merged 4 commits into
mainfrom
feat/benchmark-example

Conversation

@petercorke

Copy link
Copy Markdown
Owner

Adds examples/benchmark.py: times building, copying, pickling, components, closest, the matrix forms and the three path planners on seeded random geometric graphs of 100, 1 000 and 10 000 vertices, and prints a table with the growth exponent between the smallest and largest size.

  • --directed uses DGraph; --quick skips the largest graph; --sizes, --seed, --matrix-max.
  • --rst prints the table as a reST list-table for the docs.
  • --plot also times plot() plus a draw (off by default, backend dependent).
  • numpy and the standard library only. It fails loudly if path_UCS and path_Astar disagree on the path cost.
  • About 16 s for the default run, 5 s with --quick.

Also completes a sentence in examples/README.md that had been cut off mid-line, and documents the benchmark there.

It already earned its keep: it showed path_BFS growing as roughly N^1.8, fixed in #54.

Not wired into CI; timings depend on the machine.

🤖 Generated with Claude Code

petercorke and others added 2 commits October 12, 2026 13:56
Times building, copying, pickling, components, closest, the matrix forms and
the three path planners on seeded random geometric graphs of 100, 1 000 and
10 000 vertices, with the growth exponent between the smallest and largest.
--directed, --quick, --sizes, --plot and --rst (a table for the docs).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@codacy-production

codacy-production Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 74 complexity · 0 duplication

Metric Results
Complexity 74
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@codecov

codecov Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.61%. Comparing base (e658676) to head (bc8e844).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #55   +/-   ##
=======================================
  Coverage   96.61%   96.61%           
=======================================
  Files           3        3           
  Lines        1358     1358           
=======================================
  Hits         1312     1312           
  Misses         46       46           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@petercorke
petercorke merged commit 3b50b04 into main Oct 12, 2026
12 checks passed
@petercorke
petercorke deleted the feat/benchmark-example branch October 12, 2026 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant