Page MenuHomePhabricator

[Stretch] Namespace ZObject tables to remove the extra complexity of deleting Detached objects
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 other use cases, we propose namespacing ZObject storage, to address the complexity of making subsequent function calls in the Function Evaluator widget.

Implementation details

Currently as described in the background section Detached objects are all mixed in the same Array. While making calls of the same function with the Function Evaluator, the previous response needs to be erased before saving the new one. Erasing a detached object means, for a table of N rows:

  • Running getChilldrenByParentRowId max of N time.
  • Running getRowIndexById max of N times.

This deletion has a complexity of O(n²)

This is a big problem (causing for:

  • Large Wikidata item fetches.
  • Whenever we re-enable nested metadata (see object size table in the performance analysis document to understand the size difference)

Desired behavior/Acceptance criteria

  • Making a subsequent call in the Function Evaluator widget has a negligible performance cost compared to making the first call.

Completion checklist

Event Timeline

DSantamaria triaged this task as Medium priority.Apr 9 2025, 4:56 PM

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

[mediawiki/extensions/WikiLambda@master] Migrate ZObject internal representation from flat table to nested object

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

gengh changed the task status from Open to In Progress.Jul 1 2025, 12:37 PM
gengh claimed this task.

As part of the zobject store migration in T396360, we've also added three different zobject namespaces for: main zobject, function call and function call response.

Change #1126604 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] Migrate ZObject internal representation from flat table to nested object

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