From 3839f4d1df13822fed95ea96b0b94e344c8330b8 Mon Sep 17 00:00:00 2001 From: Dorian Niemiec Date: Sat, 27 Apr 2024 05:53:08 +0200 Subject: [PATCH] When stdout is not a terminal, disable it to improve performance of SVR.JS --- svr.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/svr.js b/svr.js index bc2c380..8c9a90a 100644 --- a/svr.js +++ b/svr.js @@ -934,6 +934,14 @@ function calculateNetworkIPv4FromCidr(ipWithCidr) { }).join("."); } +if (!process.stdout.isTTY) { + // When stdout is not a terminal, disable it to improve performance of SVR.JS + console.log = function () {}; + process.stdout.write = function () {}; + process.stdout._write = function () {}; + process.stdout._writev = function () {}; +} + // IP and network inteface-related var ifaces = {}; var ifaceEx = null;