vorto
vorto copied to clipboard
Optimize model mapping retrieval
This is a spin off of #2599.
Similar situation but different UI - in fact the optimization is likely back-end only here.
Querying model mappings can take an extravagant amount of time.
I suppose some fork/join implementation could help in ModelRepository#getMappingModelsForTargetPlatform
, keeping in mind the usual requirements (injection of security context and request attributes, bypassing JRC session helper until fixed for concurrent usage...).
From a first analysis, the situation here differs from the model details UI (see #2599) insofar as the REST calls to the back-end in the AngularJS controller are terse insofar as the UI controller does not spawn REST calls iteratively for each property of a main model payload. Conversely, this means the optimization available will likely consist in leveraging concurrency in the back-end, with little to no modification to the UI controller.
Late comment: the optimization so far consisted mostly in introducing concurrency to the large amount of grinding occurring in the back-end while retrieving a mapping model. Unfortunately, manual tests only show a small boost (from a 45" average to a 30" average). This is not good enough, and there's no telling how it scales either. Parked this for now, but there are two further steps to do:
- Introduce test plans in jmeter for a simple mapping (relevant models already pushed to source control for that purpose, just need to edit the jmx)
- Likely, fork this into a broader, "refactory" task concerning the way mappings are processed in the back-end right now, i.e. decorating with concurrency is not good enough on its own, and the code certainly could use a lot of rewriting.