mirror of
https://github.com/i2p/i2p.i2p.git
synced 2026-05-12 23:15:02 +00:00
Console: Improve writing efficiency
replace out.write(buf.toString) with out.append(buf) to eliminate extra copy and object churn
This commit is contained in:
@@ -807,7 +807,7 @@ public class TransientSessionKeyManager extends SessionKeyManager {
|
||||
buf.append(size).append('/').append(ts.getOriginalSize()).append(" tags remaining</li>");
|
||||
}
|
||||
buf.append("</ul></td></tr>\n");
|
||||
out.write(buf.toString());
|
||||
out.append(buf);
|
||||
buf.setLength(0);
|
||||
}
|
||||
buf.append("<tr><th colspan=\"2\">Total inbound tags: ").append(total).append(" (")
|
||||
@@ -841,7 +841,7 @@ public class TransientSessionKeyManager extends SessionKeyManager {
|
||||
buf.append(size).append('/').append(ts.getOriginalSize()).append(" tags remaining; acked? ").append(ts.getAcked()).append("</li>");
|
||||
}
|
||||
buf.append("</ul></td></tr>\n");
|
||||
out.write(buf.toString());
|
||||
out.append(buf);
|
||||
buf.setLength(0);
|
||||
}
|
||||
buf.append("<tr><th colspan=\"2\">Total outbound tags: ").append(total).append(" (")
|
||||
@@ -849,7 +849,7 @@ public class TransientSessionKeyManager extends SessionKeyManager {
|
||||
.append("; sessions: ").append(outbound.size())
|
||||
.append("</th></tr>\n</table>");
|
||||
|
||||
out.write(buf.toString());
|
||||
out.append(buf);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -822,7 +822,7 @@ public class RatchetSKM extends SessionKeyManager implements SessionTagListener
|
||||
}
|
||||
}
|
||||
buf.append("</ul></td></tr>\n");
|
||||
out.write(buf.toString());
|
||||
out.append(buf);
|
||||
buf.setLength(0);
|
||||
}
|
||||
buf.append("<tr><th colspan=\"2\">Total inbound tags: ").append(total).append(" (")
|
||||
@@ -876,14 +876,14 @@ public class RatchetSKM extends SessionKeyManager implements SessionTagListener
|
||||
buf.append("</li>");
|
||||
}
|
||||
buf.append("</ul></td></tr>\n");
|
||||
out.write(buf.toString());
|
||||
out.append(buf);
|
||||
buf.setLength(0);
|
||||
}
|
||||
buf.append("<tr><th colspan=\"2\">Total sets: ").append(totalSets)
|
||||
.append("; sessions: ").append(outbound.size())
|
||||
.append("</th></tr>\n</table>");
|
||||
|
||||
out.write(buf.toString());
|
||||
out.append(buf);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -308,7 +308,7 @@ public class RouterAppManager extends ClientAppManagerImpl {
|
||||
buf.append("<div class=\"debug_container\">");
|
||||
toString2(buf);
|
||||
buf.append("</div>");
|
||||
out.write(buf.toString());
|
||||
out.append(buf);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -81,7 +81,7 @@ public class PersistSybil {
|
||||
buf.append(h.toBase64()).append(':');
|
||||
p.toString(buf);
|
||||
buf.append('\n');
|
||||
out.write(buf.toString());
|
||||
out.append(buf);
|
||||
buf.setLength(0);
|
||||
}
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user