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
- Before closing this task, review one by one the checklist available here: https://www.mediawiki.org/wiki/Abstract_Wikipedia_team/Definition_of_Done#Front-end_Task/Bug_Completion_Checklist