> But it turns out that a C compiler will give you the "perfect" code directly while the comptime Zig version is fairly complicated.
In this case both would (or could) give the "perfect" code without any explicit comptime programming.
> I just realized at some point that it isn't actually all that useful.
Except, again, C code often uses macros, which is a more cumbersome mechanism than comptime (and possibly less powerful; see, e.g. how Zig implements printf).
I agree that comptime isn't necessarily very useful for micro optimisation, but that's not what it's for. Being able to shift computations in time is usedful for more "algorithmic" macro optimisations, e.g. parsing things at compile time or generating de/serialization code.