Skip to content

TPO: avoid multiple fqdn_no_alias

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

As it was identified in #1306 (closed), the function fqdn_no_alias we being called too many times: 2017 times per 500 attributes. This function only needs to be called when connecting to the database, so we removed all the other conversions when creating the models.
To fix this we removed the reimplementation of getUriGroups on authority, device and attribute levels, since their only function was to convert the host to the fqdn version. Removing them but keeping the conversion before creating the connection to the DB should reduce the number of calls while keeping the full functionality.
The time optimization is not so big, since the the 2000 calls only took 2-3 ms and it's reduced by 1ms. But we reduced the number of calls to 3, which is a nice optimization anyways.
5.1.8 (using localhost):
image
5.1.8 (using a pqdm that needs to ask for fqdn):
image
Fix (using localhost):
image
Fix (using a pqdm that needs to ask for fqdn):
image

Edited by Miquel Navarro

Merge request reports