/
Optimize factory profiling code [5.3.0-B1]
Optimize factory profiling code [5.3.0-B1]
Class factory is used to instantiate classes on demand. As being 2nd most important component of In-Portal (after unit configs) it needs to be as fast as possible for not to slow down anybody. Luckily there is a profiler code in place, but code itself isn't efficient because it checks "if profiler" enabled each time it's called knowing upfront, that profiler can't be disabled in the middle of application run.
Solution
- detect once if profiler is enabled and store it somewhere
- use stored value when collecting profiler information