tvl-depot/users/sterni/nix
sterni 8615322bc8 refactor(sterni/nix/utf8): use genericClosure for decoding iteration
builtins.genericClosure is a quite powerful (and undocumented) Nix
primop: It repeatedly applies a function to values it produces and
collects them into a list. Additionally individual results can be
identified via a key attribute.

Since genericClosure only ever creates a single list value internally,
we can eliminate a huge performance bottleneck when building a list in a
recursive algorithm: list concatenation. Because Nix needs to copy the
entire chunk of memory used internally to represent the list, building
big lists one element at a time grinds Nix to a halt.

After rewriting decode using genericClosure decoding the LaTeX source
of my 20 page term paper now takes 2s instead of 14min.

Change-Id: I33847e4e7dd95d7f4d78ac83eb0d74a9867bfe80
2021-11-23 14:22:24 +01:00
..
char chore(3p): update NixOS channels to 2021-08-30 2021-08-30 17:06:40 +00:00
flow feat(users/sterni/nix/flow): add switch conditional 2021-03-05 11:07:41 +00:00
fun feat(sterni/nix/fun): add hasEllipsis 2021-04-12 17:47:53 +00:00
html feat(users/sterni/nix): cursed nix html DSL 2021-08-26 15:34:58 +00:00
int feat(users/sterni/nix/utf8): pure nix utf-8 decoder 2021-03-05 11:07:41 +00:00
string feat(users/sterni/nix/string): very simple printf implementation 2021-09-12 09:25:30 +00:00
url feat(sterni/nix/url): implement urldecoding 2021-04-01 13:09:46 +00:00
utf8 refactor(sterni/nix/utf8): use genericClosure for decoding iteration 2021-11-23 14:22:24 +01:00