From 797340f7f82c29c15c8f59a39856bacbd0a74d53 Mon Sep 17 00:00:00 2001 From: Roland Dobai Date: Mon, 18 Jun 2018 12:49:04 +0200 Subject: [PATCH] idf_monitor: Fix console performance https://github.com/espressif/esp-idf/commit/51e42d8e925a20011bb7105da8cc3194d6940a6f introduced filtering options which handles the last (unterminated) line with a delay. This introduced poor performance for console applications when the user interacts with the ESP32 device in the same line because there is an artificial delay for each key-press. https://github.com/espressif/esp-idf/commit/bb152030a0057c5a9a048782f917c4fa9d7b770e decreased the delay but there are still delays for each key-presses. The current fix makes only one delay per line instead of each key-presses. When an unterminated line is detected then no more "delayed" print is used for the given line. Fixes https://github.com/espressif/esp-idf/issues/2054 --- tools/idf_monitor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/idf_monitor.py b/tools/idf_monitor.py index 1e76d4372..9bb0712a4 100755 --- a/tools/idf_monitor.py +++ b/tools/idf_monitor.py @@ -393,8 +393,8 @@ class Monitor(object): # default we don't touch it and just wait for the arrival of the rest # of the line. But after some time when we didn't received it we need # to make a decision. - if finalize_line and self._last_line_part != b"": - if self._line_matcher.match(self._last_line_part): + if self._last_line_part != b"": + if self._force_line_print or (finalize_line and self._line_matcher.match(self._last_line_part)): self._force_line_print = True; if self._output_enabled: self.console.write_bytes(self._last_line_part)