setMetadataValues (called from WikifunctionsObjects.js:430, the top-level result-envelope assembly) walks the singly-linked metadata list once per key being set. For n metadata entries that is O(n²) where O(n) is achievable, on the hot path of every orchestrate call.
Desired behavior/Acceptance criteria
- Rewrite setMetadataValues in function-schemata to walk the list once: either append in a batch at the tail, or build the list bottom-up from the new entries.
- Paired MR in function-schemata; submodule bump in function-orchestrator.
- All existing tests pass.
- Micro-benchmark the orchestrate-end overhead in isolation and confirm the improvement scales with metadata count.