Skip to content

perf(cron): reuse collation within name-sorted job lists - #135597

Merged
steipete merged 3 commits into
mainfrom
codex/perf50-cron-name-collation
Sep 1, 2026
Merged

steipete merged 3 commits into
mainfrom
codex/perf50-cron-name-collation

Conversation

@steipete

@steipete steipete commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Name-sorted cron lists construct an ICU collator for every comparison because localeCompare receives explicit options. The cost grows with the full filtered job list, even when the caller requests one small page.

This change keeps one lazy Intl.Collator comparison function within sortCronJobs. Empty, single-job and numeric sorts do not construct it. Locale and sensitivity defaults, ascending ID tie-breaks, missing-last numeric ordering, input ownership, filtering and snapshot revisions stay unchanged. The adjacent missing-time branches collapse into one equivalent branch. Production: +9/−10 lines, net −1; test and test-support changes total +7/−2, net +5; no new dependency, configuration, schema or persistent cache.

The narrow lint suppression documents a language contract: Intl.Collator.compare returns a bound function. Node's localeCompare implementation shows the explicit-options cache exclusion; the compare getter retains the bound function.

Measured behavior

One fixed before/candidate/candidate/before sequence on Node 26.8.1, with actual SQLite-backed cron services and authenticated loopback Gateway requests. Each of 12 rows has one first use, eight warmups and 31 measured observations in each host: 1,920 observations, with full returned values, serialized output, revisions, timings and RSS retained. The clock includes the entire list operation and JSON serialization; Gateway rows also include transport. No output normalization, excluded outliers, workload retuning or timing retries.

Complete operation Before median, two orders Candidate median, two orders Reduction
Service, 32 jobs sorted by name 412 / 444 µs 220 / 228 µs 47 / 49%
Service, 128 jobs sorted by name 1.767 / 1.782 ms 0.504 / 0.522 ms 71 / 71%
Gateway, 50-job Control UI request 4.151 / 4.040 ms 3.805 / 3.617 ms 8 / 10%
Gateway, later page of 128 jobs 5.490 / 5.949 ms 4.390 / 4.528 ms 20 / 24%

All four primary rows exceeded the predeclared 3% improvement requirement in both orders. No control exceeded the predeclared 3% regression limit in both orders. This is a name-sort improvement, with real limits:

  • The numeric timestamp control was slower by 1 / 14 µs (+0.22 / +3.06%). The default full RPC control was +3.63 / −0.48%; singleton and other control changes were also directionally mixed.
  • First default service reads were +60 / +49 µs. First default RPC reads with previews were +90 / +1,459 µs. The later name-page first read was +291 µs in the forward order. These prevent a universal first-use improvement claim.
  • Candidate whole-host peak RSS was +0.54 / +1.13%; post-Gateway sample RSS was often 32–94 MB higher. No memory benefit or GC explanation is claimed.
  • The reverse candidate retained a 77 ms full-request sample and its 56 ms server response log. No slow samples were removed.

Validation

The original paired native proof compares 24 complete output cases: Unicode and case ties, both directions, unchanged ID ordering, malformed helper-only inputs, all 72 numeric/missing combinations, page isolation, full revisions and off-page mutations, defaults, filtering and invalid RPC parameters. Both variants have complete startup logs, the expected two disabled managed jobs, clean shutdown and verified process/database/coordinator cleanup. Earlier successful proof runs without native logs were retained as incomplete evidence and were not used for timing.

Measurements are pinned to 3a6654c851582b81f15f9c54dc5deacf5e5f945a. After pulling main 213975df7583433c088dc18e755d5c870156fa9f, fresh validation covered the newer startup catch-up code:

  • 248 existing tests per variant, across five complete files and two canonical projects: sort guards, nonblocking reads, past-due reads, startup catch-up and Gateway cron validation.
  • A fresh native Gateway run on the integrated candidate matched all 24 earlier output byte streams exactly. Full startup logs and disabled managed jobs were inspected; every observed process/group, temporary database, coordinator and listener closed. Its slower startup and 96 ms status response remain compatibility evidence, not a speed comparison.
  • Independent source/raw-data review checked all 1,920 observations and 24 paired cases, including slower controls and cleanup. Codex review found no actionable issues.
  • Final pnpm check:changed: passed (224.8 seconds). The first run passed typechecks and guards but flagged the specified bound function as an unbound method; the explanatory suppression passed a separate type-aware lint run. It adds only a comment to the measured executable source.

The fixed timing result SHA-256 is da1466e6076a569af57168ee450c1e229bbe6981846f9529d073dce97ccfbc95; independent audit seal is c9b0f22ff19833ccbd8f42a83546f366056fc481877de4aa1a2ef8184c72536e. Raw local artifacts are retained; hosted checks provide the independently runnable repository validation.

No changelog or public API/docs changes are needed. Release context: reduce overhead when operators or clients list cron jobs sorted by name.

A separate source-only follow-up records that visibility-scoped pagination should be reproduced under concurrent mutation to check snapshot consistency. It is unconfirmed and predates this comparator change.

CI caught the repository suppression inventory missing the intentional Intl.Collator.compare lint exception. Head 24d9a1c adds one exact allowlist entry and its bound-getter explanation (two test lines); production remains +9/−10, net −1. All four suppression-guard tests, the changed-file checks, and a fresh structured review pass. No runtime code or historical measurements changed. The failed CI result is retained and the updated head runs normal CI.

The second CI run exposed a sidebar test selector made ambiguous by upstream #135523: a new heading now also uses .hover-marquee. This PR includes the bounded test repair: select the catalog session label and assert its old and new text while retaining replacement/style checks. The full sidebar suite reproduced one failure out of 323 before the edit and passed all 323 afterward. The refreshed complete PR passed a new structured Codex review and changed-file checks. The current head includes this test-only repair and a rebase onto a6f0d094; the cron production owner remains byte-identical to the previously measured candidate. No UI production behavior changed.

@clawsweeper

clawsweeper Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Sep 1, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 1, 2026
@clawsweeper

clawsweeper Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 1, 2026, 7:08 PM ET / 23:08 UTC.

ClawSweeper review

What this changes

The PR reuses one lazy ICU name comparator per cron-job list sort, documents its lint exception, and narrows a sidebar test selector made ambiguous by a merged UI change.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

Keep open for maintainer handling. The introduced comparator is locally scoped and preserves the existing sort contract; no correctness or security defect was found, but this member-authored, maintainer-labeled PR still has incomplete exact-head checks.

Priority: P3
Reviewed head: 1f9e259f7bc9200a92d22786f943e7cc9d7b6495
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, net-negative implementation with a credible owner-boundary rationale; exact-head CI remains the outstanding merge gate.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: The author is a repository member, so the external-contributor proof gate does not apply; the PR body nevertheless describes SQLite-backed service and authenticated loopback Gateway observations, while the prepared media contains only the related UI PR screenshots.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The author is a repository member, so the external-contributor proof gate does not apply; the PR body nevertheless describes SQLite-backed service and authenticated loopback Gateway observations, while the prepared media contains only the related UI PR screenshots.
Evidence reviewed 5 items Introduced sort behavior: The PR lazily creates an Intl.Collator compare function only for name sorting and retains the existing ID tie-breaker; numeric ordering remains on the same owner path.
Caller and owner boundary: listPage filters the complete job set, calls sortCronJobs once, derives the snapshot revision, then slices the requested page, so a comparator local to sortCronJobs covers the complete ordering operation without becoming shared state.
Existing sort-contract coverage: The focused cron test covers name-sort handling, deterministic paging, missing-last next-run ordering in both directions, and equivalence of paged and unpaginated output.
Findings None None.
Security None None.

How this fits together

Cron job lists are filtered and sorted in the cron service before a paged response reaches Gateway, Control UI, and operator callers. The changed comparator only affects name ordering within that list transformation.

flowchart LR
  A[Cron jobs] --> B[Filter and snapshot]
  B --> C[Sort job list]
  C --> D{Name sort?}
  D -->|Yes| E[Local ICU comparator]
  D -->|No| F[Timestamp ordering]
  E --> G[Paged response]
  F --> G
  G --> H[Gateway and Control UI]
Loading

Decision needed

Question Recommendation
Should this member-authored cron-list performance optimization land once its exact-head checks are complete and green? Land after green checks: Accept the local comparator optimization after the current head's required checks finish successfully.

Why: The PR carries the protected maintainer label and its author is a repository member, so automated cleanup must leave the merge decision to maintainers.

Before merge

  • Resolve merge risk (P1) - Exact-head CI is still incomplete, so this review does not establish merge readiness.
  • Resolve merge risk (P1) - The PR's engine-specific cache explanation could not be independently checked against the cited Node/V8 source because this environment cannot resolve the upstream network; functional equivalence was reviewed from the OpenClaw owner path.
  • Complete next step (P2) - No repair is indicated; retain this PR for its member author and the protected maintainer review path while exact-head checks finish.
Agent review details

Security

None.

PR surface

Source -1, Tests +5. Total +4 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 9 10 -1
Tests 2 7 2 +5
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 16 12 +4

Review metrics

Metric Value Why it matters
Production versus test delta production −1; tests/test support +5 The runtime optimization is net-negative; added test lines document the intentional lint exception and make the sidebar lifecycle selector specific.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the comparator scoped to one complete list sort rather than introducing a process-wide locale cache, then land after the current head has a complete green check rollup.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep the comparator scoped to one complete list sort rather than introducing a process-wide locale cache, then land after the current head has a complete green check rollup.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this PR optimizes an existing implementation rather than reporting a broken behavior. The source path and its caller establish where name-sorted lists are processed.

Is this the best way to solve the issue?

Yes for the functional change: the sort owner is the narrowest place to reuse collation while avoiding process-wide locale state; a global cache would broaden lifetime and locale assumptions without helping other sort modes.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against d9d19fefb4bb.

Labels

Label justifications:

  • P3: This is a bounded performance improvement with no demonstrated user-facing regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The author is a repository member, so the external-contributor proof gate does not apply; the PR body nevertheless describes SQLite-backed service and authenticated loopback Gateway observations, while the prepared media contains only the related UI PR screenshots.

Evidence

What I checked:

  • Introduced sort behavior: The PR lazily creates an Intl.Collator compare function only for name sorting and retains the existing ID tie-breaker; numeric ordering remains on the same owner path. (src/cron/service/list-page-sort.ts:10, 1f9e259f7bc9)
  • Caller and owner boundary: listPage filters the complete job set, calls sortCronJobs once, derives the snapshot revision, then slices the requested page, so a comparator local to sortCronJobs covers the complete ordering operation without becoming shared state. (src/cron/service/ops-read.ts:379, 1f9e259f7bc9)
  • Existing sort-contract coverage: The focused cron test covers name-sort handling, deterministic paging, missing-last next-run ordering in both directions, and equivalence of paged and unpaginated output. (src/cron/service.list-page-sort-guards.test.ts:52, 1f9e259f7bc9)
  • Current-main necessity: Fetched current main still calls localeCompare with explicit sensitivity options for each name comparison, so the central optimization is not already implemented on main. (src/cron/service/list-page-sort.ts:15, d9d19fefb4bb)
  • Feature history: History identifies prior cron sorting work on this file, including the paused-job ordering repair, as authored by the same area contributor; the local blobless checkout could not retrieve all older blobs for line-introduction verification. (src/cron/service/list-page-sort.ts, c51fd61e1ac3)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Patrick-Erichsen: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Wait for the exact-head check rollup to complete green before landing.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-09-01T22:26:13.768Z sha 4d1be09 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-01T22:44:51.338Z sha 24d9a1cfe9ba228e99702db4550fbd7c90bdb615 :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the codex/perf50-cron-name-collation branch from 24d9a1c to 1f9e259 Compare September 1, 2026 23:00
@openclaw-barnacle openclaw-barnacle Bot added the app: web-ui App: web-ui label Sep 1, 2026
@steipete

steipete commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

Exact-head CI is now green for 1f9e259f7bc9200a92d22786f943e7cc9d7b6495: CI run. The latest ClawSweeper rank-up item is satisfied, and native prepare completed using the hosted CI gate.

The reviewer's upstream-network limitation is covered by the retained direct Node 26.8.1 source inspection: StringLocaleCompare excludes explicit options from the default-collator cache, and the compare getter returns its bound comparison function. The PR's per-sort ownership and all disclosed performance limits remain unchanged.

Landing under the maintainer's explicit autonomous performance-campaign direction. Fresh structured review found no actionable findings; the complete sidebar suite passes 323 tests after the bounded test-selector repair. No GitHub-enforced approval rule is bypassed.

@steipete
steipete merged commit 013fe71 into main Sep 1, 2026
292 checks passed
@steipete
steipete deleted the codex/perf50-cron-name-collation branch September 1, 2026 23:16
@steipete

steipete commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Sep 1, 2026
Account for newly tracked artifact tests and internal workflow-only inputs. Keep synthetic runner timing checks independent of unrelated suite budgets. Reuse the catalog-row selector fix already landed in #135597.
steipete added a commit that referenced this pull request Sep 1, 2026
Use the canonical session-label selector landed in #135597. Keep both label-value checks and all marquee reset assertions while removing the duplicate conflict.
steipete added a commit that referenced this pull request Sep 1, 2026
Use the canonical session-label selector landed in #135597. Keep both label-value checks and all marquee reset assertions while removing the duplicate conflict.
steipete added a commit that referenced this pull request Sep 1, 2026
* ci: separate Control UI browser concurrency owners

* test(ci): keep shared config routing guard scoped

* ci: build only runtime artifacts for browser extension proof

* ci: balance combined Control UI project shards

* docs(ci): clarify UI bootstrap and runner concurrency

* test(ui): sample the sheet animation from its start

* fix(ci): stabilize browser checks and reuse E2E setup

* fix(ci): preserve tab rollback and await child readiness

Keep unfinished-tab cleanup owned by its creator after the relay closes while retaining group and access revocation checks. Await the Windows process fixture readiness event before expiring its existing cleanup deadline.

* docs: retain Chrome release context in the PR

Chrome tab access: prevent newly created tabs from losing access during group setup, keep revocations effective for in-flight commands, recover automation after selected-group access is restored, and clean up unfinished tabs when the relay disconnects.

* test: select the catalog session label for marquee resets

Scope the lifecycle fixture to the session row after catalog headings gained their own marquee. Assert both label values while retaining DOM replacement, class, and style checks. Reproduced on main before the fix; all 323 sidebar tests pass afterward.

* test: align catalog label selector with main

Use the canonical session-label selector landed in #135597. Keep both label-value checks and all marquee reset assertions while removing the duplicate conflict.
steipete added a commit that referenced this pull request Sep 2, 2026
* ci: refit shard weights within existing runner caps

* ci: retain support shard costs across inventory changes

* test: select the catalog session label for marquee resets

Scope the lifecycle fixture to the session row after catalog headings gained their own marquee. Assert both label values while retaining DOM replacement, class, and style checks. Reproduced on main before the fix; all 323 sidebar tests pass afterward.

* test: align catalog label selector with main

Use the canonical session-label selector landed in #135597. Keep both label-value checks and all marquee reset assertions while removing the duplicate conflict.
steipete added a commit that referenced this pull request Sep 2, 2026
Account for newly tracked artifact tests and internal workflow-only inputs. Keep synthetic runner timing checks independent of unrelated suite budgets. Reuse the catalog-row selector fix already landed in #135597.
steipete added a commit that referenced this pull request Sep 2, 2026
…35639)

* perf(release): prepare publication artifacts during validation

* fix(release): scope npm registry environment restoration

* test(ci): align release artifact verification fixtures

Account for newly tracked artifact tests and internal workflow-only inputs. Keep synthetic runner timing checks independent of unrelated suite budgets. Reuse the catalog-row selector fix already landed in #135597.

* fix(release): preserve correction identity across prepared artifacts
steipete added a commit to solomonneas/openclaw that referenced this pull request Sep 2, 2026
Merge current main to inherit the canonical catalog-row test selector repair
from openclaw#135597, resolving the observed UI check failure.
Keep the reviewed optional-field producer fix, strict payload validation,
tool restrictions and real service persistence regression unchanged.
Use neutral filenames for an inherited Markdown import fixture without
changing its source-classification input or assertions.

Co-authored-by: Solomon Neas <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 2, 2026
…5597)

* perf(cron): reuse collation within name-sorted job lists

* test(cron): register bound collator lint exception

* test(ui): scope catalog marquee assertions to session rows
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 2, 2026
* ci: separate Control UI browser concurrency owners

* test(ci): keep shared config routing guard scoped

* ci: build only runtime artifacts for browser extension proof

* ci: balance combined Control UI project shards

* docs(ci): clarify UI bootstrap and runner concurrency

* test(ui): sample the sheet animation from its start

* fix(ci): stabilize browser checks and reuse E2E setup

* fix(ci): preserve tab rollback and await child readiness

Keep unfinished-tab cleanup owned by its creator after the relay closes while retaining group and access revocation checks. Await the Windows process fixture readiness event before expiring its existing cleanup deadline.

* docs: retain Chrome release context in the PR

Chrome tab access: prevent newly created tabs from losing access during group setup, keep revocations effective for in-flight commands, recover automation after selected-group access is restored, and clean up unfinished tabs when the relay disconnects.

* test: select the catalog session label for marquee resets

Scope the lifecycle fixture to the session row after catalog headings gained their own marquee. Assert both label values while retaining DOM replacement, class, and style checks. Reproduced on main before the fix; all 323 sidebar tests pass afterward.

* test: align catalog label selector with main

Use the canonical session-label selector landed in openclaw#135597. Keep both label-value checks and all marquee reset assertions while removing the duplicate conflict.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 2, 2026
* ci: refit shard weights within existing runner caps

* ci: retain support shard costs across inventory changes

* test: select the catalog session label for marquee resets

Scope the lifecycle fixture to the session row after catalog headings gained their own marquee. Assert both label values while retaining DOM replacement, class, and style checks. Reproduced on main before the fix; all 323 sidebar tests pass afterward.

* test: align catalog label selector with main

Use the canonical session-label selector landed in openclaw#135597. Keep both label-value checks and all marquee reset assertions while removing the duplicate conflict.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 2, 2026
…enclaw#135639)

* perf(release): prepare publication artifacts during validation

* fix(release): scope npm registry environment restoration

* test(ci): align release artifact verification fixtures

Account for newly tracked artifact tests and internal workflow-only inputs. Keep synthetic runner timing checks independent of unrelated suite budgets. Reuse the catalog-row selector fix already landed in openclaw#135597.

* fix(release): preserve correction identity across prepared artifacts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant