Skip to content

Conversation

@vext01
Copy link

@vext01 vext01 commented Dec 16, 2025

This does two things:

  1. In many places, when checking if a transform should skip a certain function, we check:
  • if the function is marked yk_outline
  • if the function is an optimised clone.

Optimised clones are always yk_outline, so the check is redundant there.

  1. In NoCallsInEntryBlocks.cpp, this is a transform we don't want to apply to anything yk_outline, but we only skip optimised clones, so we could slow down non-cloned functions marked yk_outline.

(I also tidied up some includes)

Measuring this, I get:

 Benchmark                 Datum1 (ms)  Datum0 (ms)  Ratio  Summary
 cd/yklua/250              37568 ± 867  36190 ± 221   0.96  3.67% faster
 HashIds/yklua/6000        10328 ± 126  10707 ± 171   1.04  3.68% slower
 bounce/yklua/1500         10654 ± 529  10266 ± 243   0.96  indistinguishable
 richards/yklua/100        48768 ± 154  47483 ±1173   0.97  indistinguishable
 towers/yklua/600          11378 ± 203  11088 ± 172   0.97  indistinguishable
 nbody/yklua/250000         5780 ± 400   5653 ±  88   0.98  indistinguishable
 fannkuchredux/yklua/10    14895 ± 991  14698 ±1127   0.99  indistinguishable
 sieve/yklua/3000           4752 ±  77   4713 ±  50   0.99  indistinguishable
 spectralnorm/yklua/1000   14983 ± 186  14876 ±  44   0.99  indistinguishable
 Heightmap/yklua/2000       9500 ± 113   9480 ± 106   1.00  indistinguishable
 fasta/yklua/500000         4093 ±  30   4093 ±  23   1.00  indistinguishable
 bigloop/yklua/1000000000  18226 ±   2  18231 ±   7   1.00  indistinguishable
 json/yklua/100            13841 ±  93  13899 ±  99   1.00  indistinguishable
 mandelbrot/yklua/500       1168 ±   1   1175 ±  10   1.01  indistinguishable
 binarytrees/yklua/15      11798 ± 164  11871 ± 134   1.01  indistinguishable
 list/yklua/1500            8906 ± 166   8963 ± 154   1.01  indistinguishable
 havlak/yklua/1500         64940 ± 311  65520 ±1662   1.01  indistinguishable
 deltablue/yklua/12000     10365 ± 137  10482 ± 140   1.01  indistinguishable
 storage/yklua/1000        28106 ± 191  28430 ± 282   1.01  indistinguishable
 queens/yklua/1000          6502 ±  18   6583 ± 170   1.01  indistinguishable
 knucleotide/yklua/        14782 ± 117  14983 ± 152   1.01  indistinguishable
 revcomp/yklua/             3534 ± 313   3622 ± 111   1.02  indistinguishable
 LuLPeg/yklua/             14927 ± 385  15403 ± 266   1.03  indistinguishable
 permute/yklua/1000         9838 ± 239  10233 ± 548   1.04  indistinguishable

The hashids effect may be real, but offline @ltratt and I agreed that in this case it's probably best to merge this, as the before behaviour is weird and likely to cause confusion.

This does two things:

1. In many places, when checking if a transform should skip a certain
function, we check:

 - if the function is marked yk_outline
 - if the function is an optimised clone.

Optimised clones are always yk_outline, so the check is redundant there.

2. In NoCallsInEntryBlocks.cpp, this is a transform we don't want to
   apply to anything yk_outline, but we only skip optimised clones, so
   we could slow down non-cloned functions marked yk_outline.

Measuring this, I get:
```
 Benchmark                 Datum1 (ms)  Datum0 (ms)  Ratio  Summary
 cd/yklua/250              37568 ± 867  36190 ± 221   0.96  3.67% faster
 HashIds/yklua/6000        10328 ± 126  10707 ± 171   1.04  3.68% slower
 bounce/yklua/1500         10654 ± 529  10266 ± 243   0.96  indistinguishable
 richards/yklua/100        48768 ± 154  47483 ±1173   0.97  indistinguishable
 towers/yklua/600          11378 ± 203  11088 ± 172   0.97  indistinguishable
 nbody/yklua/250000         5780 ± 400   5653 ±  88   0.98  indistinguishable
 fannkuchredux/yklua/10    14895 ± 991  14698 ±1127   0.99  indistinguishable
 sieve/yklua/3000           4752 ±  77   4713 ±  50   0.99  indistinguishable
 spectralnorm/yklua/1000   14983 ± 186  14876 ±  44   0.99  indistinguishable
 Heightmap/yklua/2000       9500 ± 113   9480 ± 106   1.00  indistinguishable
 fasta/yklua/500000         4093 ±  30   4093 ±  23   1.00  indistinguishable
 bigloop/yklua/1000000000  18226 ±   2  18231 ±   7   1.00  indistinguishable
 json/yklua/100            13841 ±  93  13899 ±  99   1.00  indistinguishable
 mandelbrot/yklua/500       1168 ±   1   1175 ±  10   1.01  indistinguishable
 binarytrees/yklua/15      11798 ± 164  11871 ± 134   1.01  indistinguishable
 list/yklua/1500            8906 ± 166   8963 ± 154   1.01  indistinguishable
 havlak/yklua/1500         64940 ± 311  65520 ±1662   1.01  indistinguishable
 deltablue/yklua/12000     10365 ± 137  10482 ± 140   1.01  indistinguishable
 storage/yklua/1000        28106 ± 191  28430 ± 282   1.01  indistinguishable
 queens/yklua/1000          6502 ±  18   6583 ± 170   1.01  indistinguishable
 knucleotide/yklua/        14782 ± 117  14983 ± 152   1.01  indistinguishable
 revcomp/yklua/             3534 ± 313   3622 ± 111   1.02  indistinguishable
 LuLPeg/yklua/             14927 ± 385  15403 ± 266   1.03  indistinguishable
 permute/yklua/1000         9838 ± 239  10233 ± 548   1.04  indistinguishable
```

The hashids effect may be real, but offline @ltratt and I agreed that in
this case it's probably best to merge this, as the before behaviour is
weird and likely to cause confusion.
@vext01 vext01 mentioned this pull request Dec 16, 2025
@ltratt ltratt added this pull request to the merge queue Dec 16, 2025
Merged via the queue into ykjit:main with commit eadc84d Dec 16, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants