(fix): perfomance - load ExApps menu items only when event is triggered#542
(fix): perfomance - load ExApps menu items only when event is triggered#542oleksandr-nc merged 1 commit intomainfrom
Conversation
998735f to
46b7064
Compare
|
question - will we backport this to the NC31 or not? |
kyteinsky
left a comment
There was a problem hiding this comment.
🚀
question - will we backport this to the NC31 or not?
okay to do imo
I don't get that. You only give the class name to the register listener. The listener is not initialized until the event is actually triggered. |
Ok, I will recheck that. |
…event is triggered Signed-off-by: Oleksander Piskun <oleksandr2088@icloud.com>
46b7064 to
d505473
Compare
|
I forced-pushed a slightly modified version. You are right, the class is not initialized until there is an event, so we can put After taking measurements when there are ExApps but none of them define a menu item, the code without IGroupManager, INavigationManager, IURLGenerator, IFactory in the constructor still works faster (or it is a measurement error as difference value is not so big). I would like to leave them where they are, if this does not cause any problems that I do not know about - but if it is needed, I can push a version where they are initialized in the constructor. |
|
/backport to stable31 |
Results for 5k requests:
OCS call, AppAPI enabled(before PR):
OCS call, AppAPI enabled(after PR):
For frontend calls the speed is almost the same, slight boost with less then 1%, when two ExApps define their icons.
Why this code is writtent without usual initilizing in the
__construct()?This is much faster, as this does not initialize all this classes for each request, but only initialize them for those requests where we should do the actual work.
First version of this PR was written in a nice way(with
private readonly ...in constructor), but after measurments the code was completly rewritten.