From 30b65ef3b8108368f60ff36100abf4a06ddce393 Mon Sep 17 00:00:00 2001 From: aristocratos Date: Tue, 11 Aug 2020 20:08:05 +0200 Subject: [PATCH] Fixed slowdown when showing memory in percent instead of bytes --- bpytop.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bpytop.py b/bpytop.py index e28fa98..271976b 100755 --- a/bpytop.py +++ b/bpytop.py @@ -2945,7 +2945,7 @@ class ProcCollector(Collector): #! add interrupt on _collect and _draw if CONFIG.proc_tree: cls._tree(sort_cmd=sort_cmd, reverse=reverse, proc_per_cpu=proc_per_cpu, search=search) else: - for p in sorted(psutil.process_iter(cls.p_values + ["memory_info"] if CONFIG.proc_mem_bytes else [], err), key=lambda p: eval(sort_cmd), reverse=reverse): + for p in sorted(psutil.process_iter(cls.p_values + (["memory_info"] if CONFIG.proc_mem_bytes else []), err), key=lambda p: eval(sort_cmd), reverse=reverse): if cls.collect_interrupt or cls.proc_interrupt: return if p.info["name"] == "idle" or p.info["name"] == err or p.info["pid"] == err: