From f659dc8e4923ddd5acedd764fcc0929937143a49 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Sat, 30 Dec 2017 11:21:23 -0500 Subject: [PATCH] add TODOs comments --- src/js/traffic.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/js/traffic.js b/src/js/traffic.js index d54bd161a..4d334a59d 100644 --- a/src/js/traffic.js +++ b/src/js/traffic.js @@ -672,8 +672,17 @@ var filterDocument = (function() { this.disconnect(); return; } - // TODO: possibly improve buffer growth, if benchmarking shows it's - // worth it. + // TODO: + // - Possibly improve buffer growth, if benchmarking shows it's worth + // it. + // - Also evaluate whether keeping a list of buffers and then decoding + // them in sequence using TextDecoder's "stream" option is more + // efficient. Can the data buffers be safely kept around for later + // use? + // - Informal, quick benchmarks seem to show most of the overhead is + // from calling TextDecoder.decode() and TextEncoder.encode(), and if + // confirmed, there is nothing which can be done uBO-side to reduce + // overhead. if ( filterer.buffer === null ) { if ( streamJobDone(filterer, ev.data) ) { return; } filterer.buffer = new Uint8Array(ev.data);