From 8c4ad90e6756a006243f04033ae9bd9bc9e2f095 Mon Sep 17 00:00:00 2001 From: Clement Tsang <34804052+ClementTsang@users.noreply.github.com> Date: Fri, 11 Dec 2020 19:54:02 -0500 Subject: refactor: Another small optimization pass (#350) Making some small changes that would hopefully improve performance a bit. - Remove redundant string generations for CPU data conversion - Switch to fnv for PID hashmap and hashsets - Use buffered reading to avoid having to store too many lines as strings --- src/bin/main.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/bin') diff --git a/src/bin/main.rs b/src/bin/main.rs index 8e143a39..320b100a 100644 --- a/src/bin/main.rs +++ b/src/bin/main.rs @@ -215,8 +215,12 @@ fn main() -> Result<()> { if app.used_widgets.use_cpu { // CPU - app.canvas_data.cpu_data = - convert_cpu_data_points(&app.data_collection, false); + + convert_cpu_data_points( + &app.data_collection, + &mut app.canvas_data.cpu_data, + false, + ); } // Processes -- cgit v1.2.3