66</div >
77
88<div id =" doc-begin " align =" center " >
9- <h1 id =" header " >
10- Microfetch
11- </h1 >
12- <p >
13- Microscopic fetch tool in Rust, for NixOS systems, with special emphasis on speed
14- </p >
9+ <h1 id =" header " >Microfetch</h1 >
10+ <p >Microscopic fetch tool in Rust, for NixOS systems, with special emphasis on speed</p >
1511 <br />
1612 <a href =" #synopsis " >Synopsis</a ><br />
17- <a href =" #features " >Features</a > | <a href =" #motivation " >Motivation</a ><br />
13+ <a href =" #features " >Features</a > | <a href =" #motivation " >Motivation</a ><br /> | < a href = " #benchmarks " >Benchmarks</ a >< br />
1814 <a href =" #installation " >Installation</a >
1915 <br />
2016</div >
@@ -65,34 +61,42 @@ on your system: it is pretty _[fast](#benchmarks)_...
6561
6662## Motivation
6763
68- Fastfetch, as its name probably hinted, is a very fast fetch tool written in C.
69- However, I am not interested in _ any_ of its additional features, and I'm not
70- interested in its configuration options. Sure I can _ configure_ it when I
71- dislike the defaults, but how often would I really change the configuration...
72-
73- Microfetch is my response to this problem. It is an _ even faster_ fetch tool
74- that I would've written in Bash and put in my ` ~/.bashrc ` but is _ actually_
75- incredibly fast because it opts out of all the customization options provided by
76- tools such as Fastfetch. Ultimately, it's a small, opinionated binary with a
77- nice size that doesn't bother me, and incredible speed. Customization? No thank
78- you. I cannot re-iterate it enough, Microfetch is _ annoyingly fast_ .
79-
80- The project is written in Rust, which comes at the cost of "bloated" dependency
81- trees and the increased build times, but we make an extended effort to keep the
82- dependencies minimal and build times managable. The latter is also very easily
83- mitigated with Nix's binary cache systems. Since Microfetch is already in
84- Nixpkgs, you are recommended to use it to utilize the binary cache properly. The
85- usage of Rust _ is_ nice, however, since it provides us with incredible tooling
86- and a very powerful language that allows for Microfetch to be as fast as
87- possible. Sure C could've been used here as well, but do you think I hate
88- myself?
89-
90- > [ !IMPORTANT]
91- > ** Update as of November 30th, 2025** :
92- >
93- > Microfetch now inlines handwritten assembly for even better performance. I
94- > know I previously said I do not hate myself but I'm beginning to suspect this
95- > is no longer the case. Enjoy the performance benefits!
64+ [ Rube-Goldmark Machine ] : https://en.wikipedia.org/wiki/Rube_Goldberg_machine
65+
66+ Fastfetch, as its name _ probably_ already hinted, is a very fast fetch tool
67+ written in C. I used to use Fastfetch on my systems, but I eventually came to
68+ the realization that I am _ not interested in any of its additional features_ . I
69+ don't use Sixel, I don't change my configuration more than maybe once a year and
70+ I don't even display most of the fields that it does. Sure the configurability
71+ is nice and I can configure the defaults that I do not like but how often do I
72+ really do that?
73+
74+ Since I already enjoy programming challenges, and don't use a fetch program that
75+ often, I eventually came to try and answer the question _ how fast can I make my
76+ fetch script?_ It is an _ even faster_ fetch tool that I would've written in Bash
77+ and put in my ` ~/.bashrc ` but is _ actually_ incredibly fast because it opts out
78+ of all the customization options provided by tools such as Fastfetch. Since
79+ Fetch scripts are kind of a coming-of-age ritual for most Linux users, I've
80+ decided to use it on my system. You also might be interested if you like the
81+ defaults and like speed.
82+
83+ Ultimately, it's a small, opinionated binary with a nice size that doesn't
84+ bother me, and incredible speed. Customization? No thank you. I cannot
85+ re-iterate it enough, Microfetch is _ annoyingly fast_ . It does not, however,
86+ solve a technical problem. The "problem" Microfetch solves is entirely
87+ self-imposed. On the matter of _ size_ , the project is written in Rust, which
88+ comes at the cost of "bloated" dependency trees and the increased build times,
89+ but we make an extended effort to keep the dependencies minimal and build times
90+ managable. The latter is also very easily mitigated with Nix's binary cache
91+ systems. Since Microfetch is already in Nixpkgs, you are recommended to use it
92+ to utilize the binary cache properly. The usage of Rust _ is_ nice, however,
93+ since it provides us with incredible tooling and a very powerful language that
94+ allows for Microfetch to be as fast as possible. ~~ Sure C could've been used
95+ here as well, but do you think I hate myself?~~ Microfetch now features
96+ handwritten assembly to unsafely optimize some areas. In hindsight you all
97+ should have seen this coming. Is it faster? Yes.
98+
99+ Also see: [ Rube-Goldmark Machine]
96100
97101## Benchmarks
98102
@@ -200,17 +204,31 @@ You can't.
200204
201205### Why?
202206
203- Customization, of any kind, is expensive: I could try reading environment
204- variables, parse command-line arguments or read a configuration file but all of
205- those increment execution time and resource consumption by a lot.
207+ Customization, of most kinds, are expensive: I could try reading environment
208+ variables, parse command-line arguments or read a configuration file to allow
209+ configuring various fields but those inflate execution time and the resource
210+ consumption by a lot. Since Microfetch is closer to a code golf challenge than a
211+ program that attempts to fill a gap, I have elected not to make this trade.
206212
207213### Really?
208214
209- To be fair, you _ can_ customize Microfetch by, well, patching it. It's not the
210- best way per se, but it will be the only way that does not compromise on speed.
215+ [ main module ] : ./src/main.rs
216+ [ discussions tab ] : https://github.com/NotAShelf/microfetch/discussions
217+
218+ To be fair, you _ can_ customize Microfetch by, well, patching it. It is
219+ certainly not the easiest way of doing so but if you are planning to change
220+ something in Microfetch, patching is the best way to go. It will also the only
221+ way that does not compromise on speed, unless you patch in bad code. Various
222+ users have adapted Microfetch to their distribution by patching the
223+ [ main module] and inserting the logo of their choice. This is also the best way
224+ to go if you plan to make small changes. If your changes are not small, you
225+ might want to look for a program that is designed to be customizable; Microfetch
226+ is built for maximum performance.
211227
212228The Nix package allows passing patches in a streamlined manner by passing
213- ` .overrideAttrs ` to the derivation.
229+ ` .overrideAttrs ` to the derivation. You can apply your patches in ` patches ` and
230+ share your derivations with people. Feel free to use the [ discussions tab] to
231+ share your own variants of Microfetch!
214232
215233## Contributing
216234
@@ -222,13 +240,22 @@ Contributions that help improve performance in specific areas of Microfetch are
222240welcome. Though, prepare to be bombarded with questions if your changes are
223241large.
224242
225- ## Hacking
243+ ### Hacking
244+
245+ A Nix flake is provided. You may use ` nix develop ` to get started. Direnv users
246+ may instead run ` direnv allow ` to get a complete environment with shell
247+ integration.
226248
227- A Nix flake is provided. ` nix develop ` to get started. Direnv users may simply
228- run ` direnv allow ` to get started.
249+ Non-Nix user will need ` cargo ` , ` clang ` and ` mold ` installed on their system to
250+ build Microfetch. As Mold seems to yield _ slightly_ better results than the
251+ default linker, it has been set as the default in ` .cargo/config.toml ` for
252+ x86-64 Linux. You may override those defaults using the ` RUSTFLAGS ` environment
253+ variable. For example:
229254
230- Non-nix users will need ` cargo ` and ` gcc ` installed on their system, see
231- ` Cargo.toml ` for available release profiles.
255+ ``` sh
256+ # Use ld instead of Mold
257+ $ RUSTFLAGS=" -C linker=/path/to/ld.lld" cargo build
258+ ```
232259
233260## Thanks
234261
@@ -245,6 +272,7 @@ person about current issues. To list a few, special thanks to:
245272- [ @sioodmy ] ( https://github.com/sioodmy ) - Being cute
246273- [ @mewoocat ] ( https://github.com/mewoocat ) - The awesome NixOS logo ASCII used
247274 in Microfetch
275+ - [ @uzaaft ] ( https://github.com/uzaaft ) - Helping me going faster
248276
249277Additionally a big thank you to everyone who used, talked about or criticized
250278Microfetch. I might have missed your name here, but you have my thanks.
0 commit comments