Description
NetworkConnectionServiceTest has the same issue in REEF-812. We need to improve inefficient code like the following.
- // build the message - final StringBuilder msb = new StringBuilder(); - for (int i = 0; i < size; i++) { - msb.append("1"); - } - final String message = msb.toString(); - + final String message = StringUtils.repeat('1', size);
Also, it would be better execute `open()` once per each connection.
+ conn.open(); for (int i = 0; i < numMessages; i++) { ... - conn.open(); - conn.write(sb.toString()); + conn.write(message); }
Attachments
Issue Links
- links to