#25522: Avoid missing identical lines during sanitization of logs -------------------------------+------------------------------ Reporter: iwakeh | Owner: metrics-team Type: defect | Status: needs_review Priority: High | Milestone: Component: Metrics/CollecTor | Version: Severity: Normal | Resolution: Keywords: metrics-2018 | Actual Points: Parent ID: | Points: Reviewer: | Sponsor: -------------------------------+------------------------------
Comment (by karsten): While we're looking at this code, should we also try to avoid allocating the potentially large `byte[] batch = bytesFor(entry.getKey(), BATCH)` if we don't need it? For example, {{{ for (Map.Entry<String, Long> entry : lines.entrySet()) { long count = entry.getValue(); byte[] batch = null; while (count > 0) { if (count > BATCH) { if (null == batch) { batch = bytesFor(entry.getKey(), BATCH); } os.write(batch); count -= BATCH; } else { os.write(bytesFor(entry.getKey(), count)); break; } } } }}} -- Ticket URL: <https://trac.torproject.org/projects/tor/ticket/25522#comment:2> Tor Bug Tracker & Wiki <https://trac.torproject.org/> The Tor Project: anonymity online
_______________________________________________ tor-bugs mailing list tor-bugs@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs