Skip to content

TPO: avoid multiple getElementAlias

Miquel Navarro requested to merge tpo-avoid-multiple-getElementAlias into develop

As it was identified in #1305 (closed), the function getElementAlias we being called too many times: twice per attribute, once per device, once per authority. I fixed it by adding a cache for the names, so each time that it tries to get the names of a device, it returns the cached name if it exists.
This small change reduced the number of calls to getElement alias to 2 (as the authority also calls it using the fullname, including schema). This reduction in the number of calls implies a reduction startup time by ~50% (depending on the library you use to check the startup time).
The time profile by tuna and snakeviz (pure 5.1.8 version on the left and the change applied on the right):
image image

Edited by Miquel Navarro

Merge request reports