Github user ptgoetz commented on the issue:

    https://github.com/apache/storm/pull/2203
  
    > Looks like we compose metric name and lookup from REGISTRY every time, 
even without executor ID and stream ID. I can see more calculation should be 
done after addressing, but not sure how much it affects performance. If we 
could also memorize metric name per combination of parameters it might help, 
but I'm also not sure how much it will help.
    
    Prior to adding stream ID, we could store the metric as a variable and 
reuse it without having to do a lookup on each use. Adding stream ID required 
(unless I'm missing something) doing the lookup on every use. There might be 
additional optimizations, but because metrics names are composed of several 
fields, some level of string concatenation is unavoidable. For example, we 
could try to optimize lookups by caching metrics with metric name as the key, 
but we would still have to do concatenation to create the lookup key.
    
    I suppose we could create a `MetricName` class to serve as the cache key, 
but we'd be trading string concatenation for object creation (unless we name 
`MetricName` mutable with `setX` methods).
    
    > Regarding issuing warning on name, +1 on your approach. Looks nice!
    
    Thanks for the feedback. Implemented in latest commit.


---

Reply via email to