Skip to content

perf(table-core): reuse accessRows function#6447

Open
43081j wants to merge 2 commits into
TanStack:betafrom
43081j:jg/access-rows-scope
Open

perf(table-core): reuse accessRows function#6447
43081j wants to merge 2 commits into
TanStack:betafrom
43081j:jg/access-rows-scope

Conversation

@43081j

@43081j 43081j commented Jul 20, 2026

Copy link
Copy Markdown

🎯 Changes

We were previously allocating an arrow function per call with its own
scope. If we move this to module level and pass table in, we can
re-use the same function allocated once

I also noticed an array being garbage collected so removed that too.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm test:pr.

Summary by CodeRabbit

  • Improvements
    • Improved processing of table rows and nested subrows for more consistent row-model generation.
    • Standardized row identifiers across root rows and nested rows, supporting more predictable row tracking and updates.
    • Preserved existing table behavior while improving reliability for hierarchical data.

43081j added 2 commits July 20, 2026 15:36
We were previously allocating an arrow function per call with its own
scope. If we move this to module level and pass `table` in, we can
re-use the same function allocated once.
@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4b302cde-8f89-4093-95a3-53de30a0a251

📥 Commits

Reviewing files that changed from the base of the PR and between 209699f and 61be262.

📒 Files selected for processing (2)
  • packages/table-core/src/core/row-models/createCoreRowModel.ts
  • packages/table-core/src/core/rows/coreRowsFeature.utils.ts

📝 Walkthrough

Walkthrough

Changes

Core row model updates

Layer / File(s) Summary
Explicit recursive row materialization
packages/table-core/src/core/row-models/createCoreRowModel.ts, packages/table-core/src/core/rows/coreRowsFeature.utils.ts
Row construction is moved to a top-level recursive accessRows helper with explicit dependencies, and row IDs use template/string construction for root and child rows.

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

Suggested reviewers: kevinvandy

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main performance change: reusing accessRows by moving it to module scope.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

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