Skip to content

Commit 6fcdaaf

Browse files
committed
docs: move README & asset to docs dir; update demo img
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I47770f97a8ddc10f66d22acf2f2d26836a6a6964
1 parent 014c1a3 commit 6fcdaaf

3 files changed

Lines changed: 40 additions & 18 deletions

File tree

.github/assets/demo.png

-20.5 KB
Binary file not shown.

README.md renamed to docs/README.md

Lines changed: 40 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<p>Microscopic fetch tool in Rust, for NixOS systems, with special emphasis on speed</p>
1111
<br/>
1212
<a href="#synopsis">Synopsis</a><br/>
13-
<a href="#features">Features</a> | <a href="#motivation">Motivation</a><br/> | <a href="#benchmarks">Benchmarks</a><br/>
13+
<a href="#features">Features</a> | <a href="#motivation">Motivation</a> | <a href="#benchmarks">Benchmarks</a><br/>
1414
<a href="#installation">Installation</a>
1515
<br/>
1616
</div>
@@ -29,7 +29,7 @@ on your system: it is pretty _[fast](#benchmarks)_...
2929
<p align="center">
3030
<img
3131
alt="latest demo"
32-
src="./.github/assets/demo.png"
32+
src="./assets/demo.png"
3333
width="850px"
3434
>
3535
</p>
@@ -55,10 +55,14 @@ on your system: it is pretty _[fast](#benchmarks)_...
5555
- Shell Colors
5656
- Did I mention fast?
5757
- Respects [`NO_COLOR` spec](https://no-color.org/)
58+
- Funny [^2]
5859

5960
[^1]: With the Mold linker, which is enabled by default in the Flake package,
6061
the binary size is roughly 350kb. That's nearly 20kb reduction in size :)
6162

63+
[^2]: I don't know how else to describe the (unhealthy) amount of handwritten
64+
assembly that was written in order to make Microfetch faster.
65+
6266
## Motivation
6367

6468
[Rube-Goldmark Machine]: https://en.wikipedia.org/wiki/Rube_Goldberg_machine
@@ -87,14 +91,15 @@ solve a technical problem. The "problem" Microfetch solves is entirely
8791
self-imposed. On the matter of _size_, the project is written in Rust, which
8892
comes at the cost of "bloated" dependency trees and the increased build times,
8993
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
94+
manageable. The latter is also very easily mitigated with Nix's binary cache
9195
systems. Since Microfetch is already in Nixpkgs, you are recommended to use it
9296
to utilize the binary cache properly. The usage of Rust _is_ nice, however,
9397
since it provides us with incredible tooling and a very powerful language that
9498
allows for Microfetch to be as fast as possible. ~~Sure C could've been used
9599
here as well, but do you think I hate myself?~~ Microfetch now features
96100
handwritten assembly to unsafely optimize some areas. In hindsight you all
97-
should have seen this coming. Is it faster? Yes.
101+
should have seen this coming. Is it faster? Yes. Should you use this? If you
102+
want to.
98103

99104
Also see: [Rube-Goldmark Machine]
100105

@@ -128,9 +133,19 @@ up to date, but I will try to update the numbers as I make Microfetch faster.
128133

129134
The point stands that Microfetch is significantly faster than every other fetch
130135
tool I have tried. This is to be expected, of course, since Microfetch is
131-
designed _explicitly_ for speed and makes some tradeoffs to achieve it's
136+
designed _explicitly_ for speed and makes some tradeoffs to achieve its
132137
signature speed.
133138

139+
> [!IMPORTANT]
140+
> Some tools are excluded. Yes, I know. If you think they are important and thus
141+
> should be covered in the benchmarks, feel free to create an issue. The purpose
142+
> of this benchmarks section is not to badmouth other projects, but to
143+
> demonstrate how much faster Microfetch is in comparison. Obviously Microfetch
144+
> is designed to be small (in the sense of scope) and fast (in every definition
145+
> of the word) so I speak of Microfetch's speed as a fact rather than an
146+
> advantage. Reddit has a surprising ability to twist words and misunderstand
147+
> ideals.
148+
134149
### Benchmarking Individual Functions
135150

136151
[Criterion.rs]: https://github.com/bheisler/criterion.rs
@@ -169,21 +184,27 @@ performance regressions.
169184
## Installation
170185

171186
> [!NOTE]
172-
> You will need a Nerdfonts patched font installed, and for your terminal
173-
> emulator to support said font. Microfetch uses nerdfonts glyphs by default,
187+
> You will need a Nerd Fonts patched font installed, and for your terminal
188+
> emulator to support said font. Microfetch uses Nerd Fonts glyphs by default,
174189
> but this can be changed by [patching the program](#customizing).
175190
176191
Microfetch is packaged in [nixpkgs](https://github.com/nixos/nixpkgs). It can be
177192
installed by adding `pkgs.microfetch` to your `environment.systemPackages`.
178-
Additionally, you can try out Microfetch in a Nix shell.
193+
Additionally, you can try out Microfetch in a Nix shell or install it using
194+
flakes on non-NixOS systems.
179195

180196
```bash
197+
# Enter a Nix shell with Microfetch; this will be lost on the next GC
181198
nix shell nixpkgs#microfetch
199+
200+
# Install Microfetch globally; this will be kept on GC
201+
nix profile add nixpkgs#microfetch
182202
```
183203

184204
Or run it directly with `nix run`
185205

186206
```bash
207+
# Run Microfetch from Nixpkgs. Subsequent runs will be faster.
187208
nix run nixpkgs#microfetch
188209
```
189210

@@ -200,15 +221,16 @@ have to be?
200221

201222
## Customizing
202223

203-
You can't.
224+
You can't*.
204225

205226
### Why?
206227

207-
Customization, of most kinds, are expensive: I could try reading environment
228+
Customization, of most kinds, is "expensive": I could try reading environment
208229
variables, parse command-line arguments or read a configuration file to allow
209230
configuring various fields but those inflate execution time and the resource
210231
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.
232+
program that attempts to fill a gap, I have elected not to make this trade. This
233+
is, of course, not without a solution.
212234

213235
### Really?
214236

@@ -217,13 +239,13 @@ program that attempts to fill a gap, I have elected not to make this trade.
217239

218240
To be fair, you _can_ customize Microfetch by, well, patching it. It is
219241
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.
242+
something in Microfetch, patching is the best way to go. It will also be the
243+
only way that does not compromise on speed, unless you patch in bad code.
244+
Various users have adapted Microfetch to their distribution of choice by
245+
patching the [main module] and inserting the logo of their choice. This is also
246+
the best way to go if you plan to make small changes. If your changes are not
247+
small, you might want to look for a program that is designed to be customizable;
248+
Microfetch is built for maximum performance and little else.
227249

228250
The Nix package allows passing patches in a streamlined manner by passing
229251
`.overrideAttrs` to the derivation. You can apply your patches in `patches` and

docs/assets/demo.png

35.3 KB
Loading

0 commit comments

Comments
 (0)