noCV
PDSL-107 · Evaluate and inspect

Measure whether interning field symbols actually reduces rule-cache memory

Practice briefTaskAdvanced

A heap profile suggests thousands of cached rules repeat the same field and operator metadata. The proposed optimization shares entire nodes, including source locations and tenant rule identifiers.

Focused work estimate
3h + prerequisites
Priority in the scenario
Low
Engineering practice
Memory profiling · Caching · Benchmark design

Estimated field mix

  • Performance engineering60%
  • Compiler and language tooling40%

Field percentages are editorial estimates of the ticket's engineering focus. They total 100%; they are not measured time, proficiency scores, or ownership evidence.

Pattern topics

  • FlyweightCompare

    Test whether sharing intrinsic symbol metadata saves enough memory while keeping source, tenant, and evaluation context out of shared objects.

Your next step

Review it, then add it to your workspace.

The board opens an editable draft; nothing is saved until you confirm it. Sign-in and workspace permissions apply, and Demo boards remain ephemeral.

Project context

A fictional fulfillment product routes parcels using destination zone, weight in grams, and service level. Its next release needs nested eligibility rules, but arbitrary customer scripts are out of scope. Create a local TypeScript baseline and synthetic parcel/rule fixtures; no starter repository or fixtures are supplied. Keep parsing and evaluation in a local practice application with no network, filesystem, or host-code expressions in the language.

Setup prerequisites

  • Recursive data structures
  • Parser error handling
  • Discriminated unions

Preceding work

Complete these dependencies, or supply their agreed outputs before taking this ticket.

Acceptance criteria

  • Benchmark an authored 10,000-rule synthetic corpus before and after sharing only immutable context-free symbols.
  • Keep source spans, rule identities, and parcel evaluation state outside shared symbols, and bound or evict the intern pool.
  • Report retained heap, parse time, and identical rule outcomes across repeated runs; retain the optimization only if the measured tradeoff justifies it.

Implementation constraints

  • State runtime, corpus seed, warmup, and measurement variability; a decision to remove the pool is an acceptable result.

Verification to include

  • Compare all evaluation outcomes and source-specific diagnostics with pooling enabled and disabled.
  • Load many distinct invalid symbols and verify rejection cannot grow the intern pool without bound or reuse another rule's source range.

Deliverables

  • Reproducible heap comparison and an evidence-backed keep-or-remove decision

Rollout and recovery

Default pooling off until the local measurements pass review; disabling it must leave serialized rule content unchanged.

Value of the work

For the engineer: Practice expression modeling, language compatibility, bounded evaluation, and deciding whether object-oriented patterns improve a small interpreter.

For the team: Review concrete tradeoffs around rule changes, diagnostic quality, resource limits, and the cost of adding an operator without breaking saved rules.

Evidence boundaries

Outcome Evidence: Tests, patches, and runbooks are requested deliverables. They become Outcome Evidence only through a qualified Mission and immutable Evidence IDs.

Ownership Evidence: Independent adaptation must be observed under a declared verification policy and cite immutable Evidence IDs. Completing a planning ticket establishes no Ownership Evidence.