Compiler: optimize scan_specified_partitions (#60852)
Remove `@isdefined` checks from scan_specified_partitions by
restructuring
the loop to always initialize variables on the first iteration. This
avoids the overhead of throw_undef_if_not checks in the generated code.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The `@isdefined` thing while cute, turns out LLVM made a mess of it and
made the control flow of the function a lot more complex than it needs
to be, so just manually unroll the function
Saves like 10ns per call to this (yeah the improvements are quite small)
This takes the Documenter precompile time from around 13.8/13.3 to
12.9/13.3. On average around 3% faster
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>