Visitar URL original
perf(dataflow): avoid repeated flow index scans by cookingwithvlad-del · Pull Request #1109 · tt-a1i/archify · GitHub
Skip to content

perf(dataflow): avoid repeated flow index scans - #1109

Open
cookingwithvlad-del wants to merge 1 commit into
tt-a1i:devfrom
cookingwithvlad-del:cookingwithvlad-del-performance-improvements
Open

cookingwithvlad-del wants to merge 1 commit into
tt-a1i:devfrom
cookingwithvlad-del:cookingwithvlad-del-performance-improvements

Conversation

@cookingwithvlad-del

Copy link
Copy Markdown

Problem and value

  • Related issue / agreed discussion, or why this is a purely mechanical documentation correction: Scoped performance improvement requested for this task; no separate issue.
  • Actual problem on the current base, intended outcome, and why it is worth maintaining: Dataflow validation calls flowList.indexOf(flow) while traversing the same flow array, causing repeated linear scans and quadratic index-lookup work. Iterating with entries() retains the same diagnostic indices with constant-time index access.
  • Before/after evidence entry point: test/dataflow-automatic-layout.test.mjs verifies unknown-endpoint diagnostics retain the correct /flows/2/to path and actionable fixes.

AI assistance and accountability

  • AI use: implementation, investigation, and tests
  • Tools and model (if known), and assisted areas: GitHub Copilot App (Auto model selection); code investigation, implementation, and focused testing
  • Accountable contributor: @cookingwithvlad-del
  • Problem origin: code inspection; performance impact is inferred from the repeated linear search and has not been benchmarked.
  • I reviewed the submitted changes and explanation, understand their impact, and can answer questions about them. Validation results and gaps are recorded below.

Stability impact

  • Impact class and changed behavior/shared callers: Local behavior in dataflow validation; replaces repeated index searches with a single indexed iteration.
  • Existing behavior preserved / intended compatibility changes / failure behavior: Diagnostic paths and supported fixes preserve their flow-array indices; no intended output or compatibility changes.

Tests run

Comparison base 10b4dd5c (dev) and candidate 34a4d345. npm run test:focus -- test/dataflow-automatic-layout.test.mjs test/layout-rules.test.mjs — PASS (181 tests, 0 skipped). The added regression protects the user-facing diagnostic path while existing renderer validation cases verify behavior remains intact. Performance impact is not benchmarked.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: tt-a1i/archify
  • Branch: dev
  • File: .coderabbit.yaml
  • Commit: 10b4dd5
  • Layers: Repository YAML
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e9432992-620f-494a-b5db-4bc9e8a76e5e
Commits

Reviewing files that changed from the base of the PR and between 10b4dd5 and 34a4d34.

Files selected for processing: 2
  • archify/renderers/dataflow/dataflow-compiler.mjs
  • test/dataflow-automatic-layout.test.mjs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

📝 Summary

Reviewed base 10b4dd5 and head 34a4d345e159f311e272af12387cad2fe0a4d416. Dataflow validation now uses entries() to preserve each flow’s collection index without repeated indexOf scans. This preserves diagnostic paths and supported fixes; no compatibility change is indicated. The added regression test checks /flows/2/to. The author reports 181 focused tests passed with 0 skipped; this result is not independently verified. No CI result is observed at the checked head. Performance was not benchmarked.

The flow-validation loop now gets each flow index from flowList.entries() instead of calling indexOf. A test checks that an unknown flow destination fails validation, reports a diagnostic at the indexed destination path, and offers fixes for that path.

Priority: Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Merge Risk: Minimal · up to 34a4d

No actionable merge-blocking risk was identified in the indexed flow-validation change.

Pre-merge checks: Passed 1 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Contribution Scope Warning The implementation is narrow and the PR explains the problem, preserved diagnostic behavior, failure case, and focused test. However, CONTRIBUTING.md requires a related issue and explicit maintainer a… Link the related improvement issue or recorded maintainer decision that approves the repeated-scan problem, value, and intended scope. If none exists, record that maintainer decision before final review, then update the PR description with …
Passed Passed checks: 1 passed
Check name Status Explanation
Validation Evidence Passed PASS. Evaluated head 34a4d345 against base 10b4dd5c. The diff changes validateDataflow to use flowList.entries() and preserves the indexed diagnostic path and fix strings. The added public CLI…
Full details: Validation Evidence

Explanation

PASS. Evaluated head 34a4d345 against base 10b4dd5c. The diff changes validateDataflow to use flowList.entries() and preserves the indexed diagnostic path and fix strings. The added public CLI regression checks /flows/2/to, failure status, and fix targets. The author reports the focused suites passed with 181 tests and 0 skipped; this result was not independently rerun. No visual or generated-output evidence is required. Runtime speed is not benchmarked, and the PR discloses that limitation, so no unsupported speedup claim is presented.

Full details: Contribution Scope

Explanation

The implementation is narrow and the PR explains the problem, preserved diagnostic behavior, failure case, and focused test. However, CONTRIBUTING.md requires a related issue and explicit maintainer agreement for performance and test changes before a formal PR (lines 10 and 22–23). The PR states “no separate issue” and provides no linked issue or recorded maintainer decision. This is a scope-readiness gap, not a confirmed runtime defect.

Resolution

Link the related improvement issue or recorded maintainer decision that approves the repeated-scan problem, value, and intended scope. If none exists, record that maintainer decision before final review, then update the PR description with the link.

Finishing Touches: 💡 1
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@BlueboxC

Copy link
Copy Markdown

Adapted 34a4d345 and its public-CLI regression into our customized 3.2.0 fork: implementation, tests and scoped attribution.

The ordinary JSON case retains /flows/2/to and its offered fix targets. I also reproduced a JavaScript API edge case: placing the same invalid flow object at positions 0 and 2 reported /flows/0/from twice. Indexed iteration now correctly reports /flows/0/from and /flows/2/from; a regression fails before the change and passes afterward.

87 focused tests pass. Sixteen complete before/after results for ordinary inputs, including invalid endpoints, repeated values and empty flows, match. No Dataflow throughput benchmark was performed.

The combined adaptation passed 3,481 general tests (134 conditional skips), 315 Chrome tests (10 skips) and 56 final package checks. Installation readback matches all 215 managed files; Node 22/26 compiler/CLI and previous-customization probes pass. The retained MIT base and the adapted Apache-2.0 portions keep their respective notices.

BlueboxC

@tt-a1i tt-a1i left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agent-assisted review at 34a4d345e159f311e272af12387cad2fe0a4d416, compared with dev e837dc4. Source and supplied evidence inspected; no local test rerun in this pass.

This narrow indexed-iteration change is worth taking: it removes a redundant search and makes each diagnostic belong to the actual flow occurrence without adding state. Scope agreed; no separate issue or throughput benchmark is needed for this small slice. The added public-CLI check usefully protects /flows/2/to and its fix targets. Please describe the repeated-reference JavaScript API case precisely: entries intentionally reports positions 0 and 2, whereas indexOf reported position 0 twice; ordinary JSON behavior is preserved. BlueboxC’s fork result is helpful corroboration rather than upstream test evidence. Integrate current dev, refresh the canonical ZIP and obtain relevant green CI before final acceptance; do not advertise an unmeasured Dataflow speedup.

@tt-a1i

tt-a1i commented Oct 28, 2026

Copy link
Copy Markdown
Owner

Thank you for #1109 and #1106. We have now weighed both against ongoing maintenance cost and would like to retain both narrow changes: #1109 removes an unnecessary lookup without adding state; #1106 keeps its precomputed indexes local to a compile and preserves the existing output contract. Neither should be advertised as an established end-to-end Agent generation speedup.

For both PRs, the remaining contributor action is one explicit personal-review confirmation and AI-use disclosure covering the submitted changes. The assistance information already present can be reused; please confirm only after actually reviewing and understanding the changes. Please also synchronize current dev and rebuild the canonical ZIP, which is currently failing freshness checks, then obtain final-head CI.

No new issue, five-project generation matrix, additional optimization candidates, or broad defensive refactor is requested. Existing focused checks and equivalent-output/stress evidence remain usable at their recorded revisions. We will keep these pending rather than merge before the contributor responsibility and packaging requirements are satisfied. Thank you for keeping the changes small.

This branch has not been deployed

No deployments
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.

3 participants