Skip to content

Versions/18.0#182

Merged
leoloso merged 90 commits into
mainfrom
versions/18.0
May 20, 2026
Merged

Versions/18.0#182
leoloso merged 90 commits into
mainfrom
versions/18.0

Conversation

@leoloso

@leoloso leoloso commented May 20, 2026

Copy link
Copy Markdown
Contributor

leoloso added 30 commits April 15, 2026 11:45
Pulls in GatoGraphQL 57a82efdb7 — replaces an `array_merge` +
`array_unique` accumulator pair with a `<id,true>` set built via
`array_flip` and append-in-place. Saves two O(N) allocations per
iteration of the per-subcomponent-type-resolver outer loop in
the structural memory hotspot `processSubcomponentData`.
…ties

Pulls in GatoGraphQL 28bee9407f — replaces four `array_merge`
accumulator sites inside `flattenRelationalDBObjectDataProperties`
with read-existing → foreach-append → write-back. The function is
73 MB / 22K calls / 3.3 KB per call on cachegrind.out.5667.
Pulls in GatoGraphQL — replaces an `array_map` + closure call in a
3-level nested foreach with an explicit `foreach` to avoid per-inner-iter
closure-context + result-array allocations in
`processSubcomponentData`.
…nents

Pulls in GatoGraphQL — replaces a quadratic `array_merge`-in-loop
accumulator with collect-into-list + single variadic
`array_merge(...$subResults)` in
`executeOnSelfAndPropagateToComponents` (88K calls / 833 bytes
each on cachegrind.out.5675).
Pulls in GatoGraphQL — promotes `addToDatasetOutputKeysWithPrefix`
to public on `AbstractComponentProcessor` and adds it to
`ComponentProcessorInterface`, fixing 3 phpstan
`method.notFound` errors at the recursive call sites.
Pulls in GatoGraphQL stages 1-3 of the structural refactor of
`processSubcomponentData`:

  Stage 1 - flat entries list: replace the 3-level nested
  `$subcomponentIDs[$dbName][$typeOutputKey][$id]` scratch structure
  with a flat list of tuples, fold the unique-IDs collection into
  the same single pass, and drop the redundant per-entry
  `databases[]->contains() && is_array()` re-check.

  Stage 2 - batch combineIDsDatafields: group `$field_ids` by
  whether they need filtering. IDs with no `already_loaded` data
  share the shared direct/conditional fields and dispatch via one
  batched `combineIDsDatafields` call (replacing N individual
  calls). IDs with already-loaded data keep individual filtered
  calls. Also replaces the per-ID `array_filter` + closure with
  an explicit foreach.

  Stage 3 - fast-paths: skip the type-qualification call and
  empty intermediate allocations when `$entries === []`; skip
  the per-ID foreach when `$subcomponent_already_loaded_id_fields`
  is empty (the common case — every ID goes to the batched call
  directly).

`processSubcomponentData` is the structural memory hotspot of
a request: 8.9 GB / 198 calls / 45 MB per call on the latest
AI-translation profile.
…Data

submodule ref: refactor processSubcomponentData (3 stages)
@leoloso leoloso merged commit 91c94db into main May 20, 2026
26 checks passed
@leoloso leoloso deleted the versions/18.0 branch May 20, 2026 07:13
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