Skip to content

perf(managed): restore lifecycle performance after Node cutover - #83

Merged
krafczyk merged 1 commit into
mainfrom
perf/restore-managed-lifecycle-performance
Oct 26, 2026
Merged

krafczyk merged 1 commit into
mainfrom
perf/restore-managed-lifecycle-performance

Conversation

@krafczyk

Copy link
Copy Markdown
Collaborator

Summary

Cached-dataset computation had become substantially slower after the Node lifecycle refactor, even when caching a single item. This restores most of that lost performance while preserving the current lifecycle and persistence guarantees. The user's actual notebook now takes 87.383s instead of 130.671s, approximately 33% less total time.

Performance evidence

Controlled fresh-Store benchmarks, medians of three runs per implementation in the same big_env:

Workload Before Node refactor (f996ea43) Before this pass (11354d8a) This PR
One cached item 6.58s 24.14s 5.09s
Same item, five extra Dataset wrappers 7.97s 48.93s 7.99s

The controlled cases improve 4.7× / 6.1× over the regression. The simple case is about 23% faster than the old implementation; the deeper recipe returns to wall-time parity, not a demonstrated further speedup. All samples restore and verify their saved result. Host load affects absolute times; the benchmark notes include CPU time and reproduction commands.

The separate user-reported notebook comparison is a single real-workload observation: compute() fell from 124.857s to 83.695s, with Dispatch/preparation bringing the total to the figures above. It is not a controlled benchmark median.

Correctness decisions

  • Environment evidence is observed once per executing invocation that captures state. Replay and capture-free explicit final selection skip inventory; later invocations observe afresh.
  • Only bounded immutable metadata interpretations are reused within the same caller's admission. Current bytes, pending flags, ownership/generation fences, selected-state availability and publication acknowledgements are still checked freshly; cancellation clears the memo.
  • Exact graph equality retains canonical evidence rather than trusting digest equality. JSON preparation and installed-file location discovery do less work while retaining closed-format validation and output contracts. Persistent formats and identity versions do not change.

Related: #78, #82

Validation

  • Affected-subsystem selection: 702 passed.
  • Routine ./tests.sh good-enough --ignore tests/old --ignore tests/dev -x tests: 4,447 passed, 29 skipped, 23m47s complete local wall time on the loaded host. Test selection was unchanged.
  • Work-count/failure tests cover authority rereads, stable graph decode reuse, changed/corrupt bytes, wrong operation IDs, caller isolation, cancellation, bounded eviction, environment failure and replay behavior.
  • Changed Python F/E9 lint and Git diff checks passed.
  • Exhaustive, installed-package and real Ray/GPU suites were not run locally; hosted routine CI is the merge gate.

Reuse invocation-scoped environment evidence and bounded immutable metadata interpretations while retaining fresh authority, ownership, generation, payload, and publication checks. Preserve exact canonical comparison evidence and eliminate duplicate JSON traversal and unnecessary installed-file probes.

Add work-count and failure-boundary coverage plus a repeatable fresh-cache benchmark. Controlled runs improve 4.7x and 6.1x over the regressed implementation; the user's notebook falls from 130.671s to 87.383s total.

Verification: 702 affected-subsystem tests passed; good-enough passed 4,447 with 29 skipped in 23m47s; changed Python F/E9 lint and diff checks passed. Exhaustive, installed-package, and real Ray/GPU suites were not run.
@krafczyk
krafczyk merged commit 361353c into main Oct 26, 2026
4 checks passed
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