Description
During REEF-807, NetworkServiceTest was revealed as the most memory consuming testsuite. Although this is just a test code, it would be better if we 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