Changeset 55c2649


Ignore:
Timestamp:
Nov 23, 2012 7:52:03 AM (7 years ago)
Author:
zab <zab@…>
Branches:
master
Children:
28ba788
Parents:
0ec77f5
Message:

kill a string allocation hotspot

File:
1 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/tunnel/pool/TunnelPool.java

    r0ec77f5 r55c2649  
    804804         *
    805805         **/
    806 
     806       
     807        final String rateName = buildRateName();
     808       
    807809        // Compute the average time it takes us to build a single tunnel of this type.
    808810        int avg = 0;
    809         RateStat rs = _context.statManager().getRate(buildRateName());
     811        RateStat rs = _context.statManager().getRate(rateName);
    810812        if (rs == null) {
    811813            // Create the RateStat here rather than at the top because
    812814            // the user could change the length settings while running
    813             _context.statManager().createRequiredRateStat(buildRateName(),
     815            _context.statManager().createRequiredRateStat(rateName,
    814816                                   "Tunnel Build Frequency", "Tunnels",
    815817                                   new long[] { TUNNEL_LIFETIME });
    816             rs = _context.statManager().getRate(buildRateName());
     818            rs = _context.statManager().getRate(rateName);
    817819        }
    818820        if (rs != null) {
     
    891893                       + " std " + wanted + " inProgress " + inProgress + " fallback " + fallback
    892894                       + " for " + toString());
    893             _context.statManager().addRateData(buildRateName(), rv + inProgress, 0);
     895            _context.statManager().addRateData(rateName, rv + inProgress, 0);
    894896            return rv;
    895897        }
     
    944946        int rv = countHowManyToBuild(allowZeroHop, expire30s, expire90s, expire150s, expire210s, expire270s,
    945947                                   expireLater, wanted, inProgress, fallback);
    946         _context.statManager().addRateData(buildRateName(), (rv > 0 || inProgress > 0) ? 1 : 0, 0);
     948        _context.statManager().addRateData(rateName, (rv > 0 || inProgress > 0) ? 1 : 0, 0);
    947949        return rv;
    948950
Note: See TracChangeset for help on using the changeset viewer.