Commit graph

20 commits

Author SHA1 Message Date
c3a6d1c93c
treewide: fix commonmark formatting in Rustdoc
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ie1a13221aded56f903156fdb35abe2ac6a6a6964
2025-11-30 15:16:00 +03:00
f8a0070986
uptime: optimize uptime calculation w/ inline assembly and custom itoa
lol, lmao even.

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ie22fbd2e9c2be5740b493bdc81caafb36a6a6964
2025-11-17 21:29:14 +03:00
ca76a6e1bd
chore: format with rustfmt nightly
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I9c9e4e010b09d37f0e0994a5407f3ce56a6a6964
2025-11-17 19:18:39 +03:00
f4f3385ff7
various: fix clippy warnings
- Adds proper documentation comments with `# Errors` sections for all
  functions returning `Result`
- `cast_precision_loss` on `u64` -> `f64` for disk sizes is acceptable
  since disk sizes won't exceed f64's precision limit in practice.
  Thus, we can suppress those.
- `cast_sign_loss` and `cast_possible_truncation` on the percentage
  calculation is safe since percentages are always 0-100. Once again,
  it's safe to suppress.

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Id4dd7ebc9674407d2be4f38ff4de24bc6a6a6964
2025-11-17 18:26:34 +03:00
2ad765ef98
various: reduce allocations where available
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I517d855b14c015569a325deb64948f3b6a6a6964
2025-11-17 18:11:45 +03:00
2a6fe2a3f1
treewide: set up Hotpath for benchmarking individual allocations
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I0351e5753996e6d0391fc9e2f329878a6a6a6964
2025-11-17 17:40:46 +03:00
9bd4c9a70a
treewide: format with nightly rustfmt rules
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ib8502372dafe2e970024f606b44825af6a6a6964
2025-11-17 16:20:43 +03:00
ErrorNoInternet
0233cdc0fc
perf: use MaybeUninit for libc buffers 2025-04-15 03:46:16 -04:00
ErrorNoInternet
9713138e94
perf: pre-allocate strings 2025-04-15 03:46:15 -04:00
e9aa9a2bbe
uptime: get rid of nix crate 2025-03-30 22:33:16 +03:00
d0f88b179c
further optimize uptime retrival
Try and minimize expensive operations (e.g., divisions and allocations) to hopefully get a
*consistent* measurable performance improvement. In my testing this brings the get_current
function duration from > 1.2600 µs to < 1.2400 µs.
2025-01-26 01:06:02 +03:00
592fb58474
get rid of color_eyre
Should never have added it. Annoyingly long compile times for no reason...
2025-01-26 00:57:02 +03:00
Ryan
1cf4f754ac
parse /proc/meminfo for memory usage (#7)
* fix: calculate memory usage via /proc/meminfo

* refactor: move sysinfo call into get_current

No longer used by anything but uptime.
2024-08-15 08:14:27 +00:00
vali
4d509839f5
pass sysinfo to system.rs and uptime.rs (#6)
Some checks are pending
Rust / build (push) Waiting to run
2024-08-15 00:29:57 +00:00
0fb8fbaae6
receive uptime from nix crate 2024-08-05 01:37:13 +03:00
cf0a52150c
minify and optimize uptime reader 2024-08-04 17:20:34 +03:00
81cdc0a281
speeding it up 2024-08-04 12:44:19 +03:00
cff4332122
clippy lints 2024-08-04 00:12:07 +03:00
42a7f2fc77
apply clippy lints 2024-08-03 23:04:26 +03:00
29e4ccc806
modularize 2024-08-03 20:42:48 +03:00