Page MenuHomePhabricator

Reduce complexity of nuclear getters by using Map instead of an Array for the flat ZObject representation
Closed, ResolvedPublic

Description

Description

During Q3 we conducted a detailed analysis of the Front End performance issues, origin and mitigation strategies.

As part of the goal to reduce the complexity of the components, we want to migrate ZObject flat representation from an Array to a Map. This would drastically improve the complexity of two of the tree nuclear Object table access methods:

  • getRowById: O(n)→O(1)
  • getChildrenByParentRowId: Still O(n)
  • getRowIndexById: O(n)→O(1)

Desired behavior/Acceptance criteria

  • ZObject store initialization converts the ZObject into a Map instead of an Array
  • All getters and setters are adapted to the new data structure
  • All tests are mocked using Map instead of Array
  • We have a way forward to improve the performance of getChildrenByParentRowId

Completion checklist

Event Timeline

DSantamaria triaged this task as Medium priority.Apr 9 2025, 4:56 PM
gengh changed the task status from Open to In Progress.Jun 2 2025, 9:57 AM
gengh claimed this task.

Change #1154409 had a related patch set uploaded (by Genoveva Galarza; author: Genoveva Galarza):

[mediawiki/extensions/WikiLambda@master] [WIP] Convert ZObject table from Array to Map

https://gerrit.wikimedia.org/r/1154409

Change #1154409 abandoned by Genoveva Galarza:

[mediawiki/extensions/WikiLambda@master] [WIP] Convert ZObject table from Array to Map

Reason:

We are not doing this, opting for a full refactor of store

https://gerrit.wikimedia.org/r/1154409