Skip to content

perf(hop): traversal optimizations and fast path (restack)#916

Merged
lmeyerov merged 2 commits intomasterfrom
restack/hop-perf
Mar 2, 2026
Merged

perf(hop): traversal optimizations and fast path (restack)#916
lmeyerov merged 2 commits intomasterfrom
restack/hop-perf

Conversation

@lmeyerov
Copy link
Contributor

@lmeyerov lmeyerov commented Feb 5, 2026

Summary

  • add hop traversal fast path and direction handling simplifications
  • add parity tests for reverse fast path
  • update changelog

Status

Testing

  • (copied from prior PR) pytest graphistry/tests/test_compute_hops.py -q

@lmeyerov lmeyerov marked this pull request as ready for review February 6, 2026 06:50
Rebased hop performance improvements onto current master, which now
includes proper otel integration from PR 915.

Changes from original PR 916:
- Simplified _domain_diff signature (remove Optional from candidates)
- Use node_col variable directly instead of Optional[str] indirection
- Remove redundant None checks in fast path
- Add IndexT type alias to typing.py

Benchmarks show 8-35% improvement across hop scenarios:
- small_linear 2hop_forward_seed0: 9.23ms → 6.79ms (26%)
- medium_linear 2hop_undirected_all: 14.95ms → 9.66ms (35%)
- medium_dense 2hop_forward_all: 17.74ms → 14.99ms (16%)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@lmeyerov lmeyerov merged commit a4e917f into master Mar 2, 2026
66 checks passed
@lmeyerov lmeyerov deleted the restack/hop-perf branch March 2, 2026 15:03
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