v8.1.28
Been reading thru the forum history on system.tag.browse() and not sure where we are these days performance-wise.
I have ~3,800 tags in a folder hierarchy with about 4-5 levels. At the 4th level there are lots of folders defined with unique device names, e.g. 12345678_DEVICE_NAME. I want to search for the device ID, e.g. "12345678" and return the full path to the folder containing that name.
The script below is part of a custom parameter binding on a view component in a flex repeater, so when the page loads the script may be called by 10-20 instances at once. Execution times are starting around 100ms and increasing to over 1,400ms for the final instance.
filter = {}
filter['name'] = "*" + equipmentID + "*"
filter['tagType'] = "Folder"
filter['recursive'] = "True"
start = system.date.now()
#search recursively for the folder with the name containing the equipment ID
results = system.tag.browse(folder, filter).results
logger.trace("%s ms to run system.tag.browse() for %s" %(system.date.millisBetween(system.date.now(), start), folder))
I'm concerned that as the number of flex repeater instances grows, and the size of our tag db grows, and the number of active clients grows, that this could get too slow.
Is there a better way?