traeak commented on code in PR #10942:
URL: https://github.com/apache/trafficserver/pull/10942#discussion_r1430495582


##########
plugins/experimental/rate_limit/limiter.h:
##########
@@ -117,12 +117,15 @@ template <class T> class RateLimiter
     memset(_metrics, 0, sizeof(_metrics));
 
     std::string metric_prefix = prefix;

Review Comment:
   > Should you use the std::string::reserve() member function for these so 
there will be only one heap allocation?
   
   This function is "initializeMetrics" which is only called during plugin 
initialization.  And there's more logic below in the function for building this 
metric_prefix string.  You might save one heap allocation with a reserve for 
something not in a performance sensitive place.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to