Commit graph

8 commits

Author SHA1 Message Date
Ryan
907112f2d1
micro optimizations (#8)
* perf: break early after parsing required meminfo

Also a match statement for compiler magic.

* perf: pre-allocate strings when reading files

* refactor: remove duplicate .to_string()

* perf: try to print everything in one syscall

println! sends a syscall for each line.

* perf: get rid of duplicate uname syscall

* perf: simplify first letter capitalization

* refactor: directly use key in match statement
2024-08-15 10:32:02 +00:00
Sora
ae76a0cbe1
refactor: remove some redundant error types (#4) 2024-08-13 20:59:11 +00:00
Ryan
13903539b7
perf: use nix::sys::utsname::uname for less syscalls (#2)
Instead of reading multiple files to get the `sysname`, `release`, and
`machine` name, use the `nix::sys::utsname::uname` function which sends a
single uname syscall instead. This increases performance and portability.

From my observations, there are ~10 less syscalls.
2024-08-05 08:08:25 +00:00
81cdc0a281
speeding it up 2024-08-04 12:44:19 +03:00
cff4332122
clippy lints 2024-08-04 00:12:07 +03:00
0e4b2d2ac1
cleanup 2024-08-04 00:05:57 +03:00
42a7f2fc77
apply clippy lints 2024-08-03 23:04:26 +03:00
29e4ccc806
modularize 2024-08-03 20:42:48 +03:00