tavianator
I'm curious how lsr compares to bfs -ls for example. bfs only uses io_uring when multiple threads are enabled, but maybe it's worth using it even for bfs -j1
But I wanted the blog post sized version to be simpler for exposition.
27.24s user 8.71s system 99% cpu 36.218 total
Admittedly the LLVM build time dwarfs the configuration time, but still. If you're only building a smaller component then the config time dominates: ninja libc 268.82s user 26.16s system 3246% cpu 9.086 totalJust from a quick peek at that repo, nowadays you can write
#if __has_attribute(cold)
and avoid the configure test entirely. Probably wasn't a thing 10 years ago though :)
Also, this is still a find-style syntax, but my bfs utility supports -exclude [3]. So you can write
bfs -type f -exclude -path ./excluded_dir
which is a bit more ergonomic.[1]: https://github.com/raforg/rawhide
[2]: https://github.com/jhspetersson/fselect
[3]: https://github.com/tavianator/bfs/blob/main/docs/USAGE.md#-e...
No, if you push and pop RCX it's fast again. I mentioned this in the blog post, `mov rcx, 1` is slow but `mov rcx, 1; push rcx; pop rcx` is fast.
In general I think people are overstating the delay of an additional 64-bit add on register file reads (though I'm not a hardware guy so maybe someone can correct me). There are carry-lookahead adders with log_2(n) == 6 gate delays. Carry-save adders might also be relevant to how they can do multiple dependent adds with 0c latency.
> And, presumably, the OP shift case here is in fact a case of there not being a built-in immediate adder and thus a need for fixup uops being inserted to materialize it?
No, the perf counters show 1 uop dispatched/retired in both the slow and fast cases.