Description
With the following use case:
- Service supports resource hierarchy with more than one level
- Large number of tags are associated with the resources, with majority of tagged resources with values for all levels in resource hierarchy
- Accessed resource does not have values for all levels in the resource hierarchy
the time required to find the tags associated with the accessed resource is significant.
When tested with a large number of tagged Ozone resources (~ 629,000) with approximately 20 tagged volumes and 103 tagged buckets and the rest being keys, the access evaluation times are:
(volume, bucket, key) : requestCount=629118, avgTimeTaken=49911ns (volume, bucket) : requestCount=103, avgTimeTaken=10738069ns (volume) : - requestCount=20, avgTimeTaken=21968890ns - requestCount=1056, avgTimeTaken=13763978ns (repeated requests in previous run multiple times)
This patch, using filtering and caching technique attempts to reduce this time.