From 821b219f345c668909b5585511eb3882a8cb7ffa Mon Sep 17 00:00:00 2001 From: ndwarshuis Date: Sat, 12 Oct 2019 10:33:32 -0400 Subject: [PATCH] ENH add some performance tweaks to processor --- drawing/Processor.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drawing/Processor.lua b/drawing/Processor.lua index f0636ff..f78e940 100644 --- a/drawing/Processor.lua +++ b/drawing/Processor.lua @@ -205,7 +205,8 @@ local update = function(cr) CriticalText.set(core.coretemp_text, cr, Util.round_to_string(0.001 * Util.read_file(core.coretemp_path, nil, '*n'))) end - local process_glob = Util.execute_cmd('ps -A -o s h') + -- trimming the string actually helps performance + local process_glob = Util.execute_cmd('ps -A -o s h | tr -d "I\n"') -- subtract one from running b/c ps will always be "running" Text.set(process.value, cr, @@ -225,7 +226,7 @@ local update = function(cr) LabelPlot.update(plot, load_percent) for r = 1, NUM_ROWS do - local pid = conky(TABLE_CONKY[r].pid, '(%S+)') + local pid = conky(TABLE_CONKY[r].pid, '(%d+)') -- may have leading spaces if pid ~= '' then local cpu = conky(TABLE_CONKY[r].cpu) local comm = Util.read_file('/proc/'..pid..'/comm')