#### Description
This is a request for a performance review of the [[ https://gerrit.wikimedia.org/r/admin/repos/mediawiki/extensions/WikiLambda | WikiLambda MediaWiki extension ]]. The initial implementation of the extension will allow users to use JSON syntax (via a JS UI or raw entry) to support invocation of extension-defined functions with extension-supported types, and support composition of those functions and types. At present, the extension-defined functions run in the PHP runtime. (Eventually users will be able to write functions in programming languages like JavaScript, but a Q2 FY 2020-2021 implementation ma not support this capabilityWikifunctions from 1-June-2021 (Tuesday) to 14-June-2021 (Monday), as we're in the early stages.)inclusive.
WikiLambda is a component of the computing infrastructure for The [[ https://meta.wikimedia.org/wiki/Abstract_Wikipedia | Abstract Wikipedia ]] initiativeThe system is composed of a JavaScript Vue client, which is targeted at community authored natural language generation routines.MediaWiki PHP middleware, For the background on the general architecture concept, refer to https://arxiv.org/pdf/2004.04733.pdfand backend Node.js orchestration/evaluation (n.b., user-defined functions will be supported in Node.js and Python in earlier releases of Wikifunctions).
#### Preview environmenthttps://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/WikiLambda/+/refs/heads/master
https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/services/function-evaluator/+/refs/heads/master
https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/services/function-orchestrator/+/refs/heads/master
This component has not been deployed to the beta cluster. We will need to plan that. However, this task is being filed in anticipation of Q2 FY 2020-2021 to ensure a slot for performance testing.#### Preview environment
It is presently possible to run the Mediawiki extension WikiLambda in [[ https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+/refs/heads/master/DEVELOPERS.md | MediaWiki-Docker ]] with minimal configuration (Vector + the extension are all that are needed). For those reading this task at its initial submission[[https://www.mediawiki.org/wiki/MediaWiki-Docker/Extension/WikiLambda | minimal configuration), we're presently discussing if and how to add CirrusSearch capabilities within Docker to aid in the frontend UX for function / type / label / signature lookupand wireup for orchestration and evaluation is in flight.
#### Which code to review
We'll be particularly interested in theWe're interested in evaluation of performance characteristics ofacross the server-executed codetiers. It should be noted that we expect this new Wikimedia project's user base to be small at first, and therefore its computational needs comparatively modest at first.
Performance evaluation of the JavaScript- and HTMLForm-based frontend UX would also be appreciated, but we're flexible on this ifand therefore its computational neededs comparatively modest at first.
#### Performance assessment
Q&A:
- What work has been done to ensure the best possible performance of the feature? So far, we haven't begun optimization for performance.
- What are likely to be the weak areas (e.g. bottlenecks) of the code in terms of performance? Type conformance checking on the JSON UGC is a known potential soft spot - functions and types nested within functions and types can become combinatorially challenging, but more importantlySnappy FTUX on the Vue client side app, having a means of type checking fast without excess database queries is likely needed.or at least effective management of user expectations for FTUX on the Vue client side app, By the time of the pertype conformance assessment we may have some approachchecking on the JSON UGC, although we're naturally interested to discuss the approach before actual implementaand function execution if at all possiblebottlenecks.
- Are there potential optimisations that haven't been performed yet? Yes, on the type conformance checking. It's a little early, but we may also be interested by the time of the review in ways to ensure that the on-wiki defined test suites can run as efficiently as possible.
- Please list which performance measurements are in place for the feature and/or what you've measured ad-hoc so far. If you are unsure what to measure, ask the Performance Team for advice: [[ mailto:performance-team@wikimedia.org | performance-team@wikimedia.org ]]. Nothing yetNot much. We do intend to have various profiling measures in place in the future, as it will likely play into different types of optimization (e.g., whether to run a function in our system-defined PHP sandbox versus executing in a Node runtime if a JavaScript UDF is also available for a function) and we'll need guards in place to monitor and address yet-to-be-defined SLOs; whether to run a function in our system-defined PHP sandbox versus executing in a Node runtime if a JavaScript UDF is also available for a function) and we'll need guards in place to monitor and address yet-to-be-defined SLOsbut this is MVP work.