Skip to content

Non-PLT control-point calls#2060

Merged
ltratt merged 1 commit intoykjit:masterfrom
Pavel-Durov:ykllvm-nonlazybind-control-point
Feb 1, 2026
Merged

Non-PLT control-point calls#2060
ltratt merged 1 commit intoykjit:masterfrom
Pavel-Durov:ykllvm-nonlazybind-control-point

Conversation

@Pavel-Durov
Copy link
Copy Markdown
Contributor

@Pavel-Durov Pavel-Durov commented Jan 31, 2026

Summary

This change optimises control point calls by removing Procedure Linkage Table (PLT) overhead, without introducing regressions in JIT‑compiled execution. It mainly improves interpreter execution time, and the effect is most visible when the JIT is disabled.

Benchmarks with disabled jit:

Datum1: yklua (this change)
Datum0: yklua (main)

confidence level: 99%

 Benchmark               Datum0 (ms)   Datum1 (ms)  Ratio  Summary           
 towers/yklua/600        90160 ± 737   86635 ± 768   0.96  3.91% faster      
 bounce/yklua/1500       90919 ± 809   87616 ± 569   0.96  3.63% faster      
 cd/yklua/250           141950 ± 203  137493 ± 252   0.97  3.14% faster      
 json/yklua/100          57641 ± 108   56055 ±1088   0.97  2.75% faster      
 deltablue/yklua/12000   34073 ± 265   33272 ±  99   0.98  2.35% faster      
 havlak/yklua/1500      198463 ± 548  193872 ±1531   0.98  2.31% faster      
 richards/yklua/100     281299 ± 565  274813 ±1201   0.98  2.31% faster      
 storage/yklua/1000      81921 ± 320   80122 ± 863   0.98  2.20% faster      
 permute/yklua/1000      91389 ±3027   88449 ± 309   0.97  indistinguishable 
 list/yklua/1500         76998 ±1422   74650 ±1694   0.97  indistinguishable 
 sieve/yklua/3000       100572 ±3446   97772 ± 886   0.97  indistinguishable 
 nbody/yklua/250000      72544 ±1456   70638 ±1303   0.97  indistinguishable 
 mandelbrot/yklua/500    41724 ±1827   40882 ± 574   0.98  indistinguishable 
 queens/yklua/1000       63764 ± 496   62811 ±1169   0.99  indistinguishable 

Benchmarks with enabled jit:

Datum1: yklua (this change)
Datum0: yklua (main)

confidence level: 99%

 Benchmark              Datum1 (ms)  Datum0 (ms)  Ratio  Summary           
 towers/yklua/600       11518 ± 536  11120 ± 280   0.97  indistinguishable 
 bounce/yklua/1500      10342 ± 220  10171 ± 497   0.98  indistinguishable 
 json/yklua/100         13929 ± 396  13783 ± 415   0.99  indistinguishable 
 richards/yklua/100     47879 ±2085  47475 ±1519   0.99  indistinguishable 
 sieve/yklua/3000        4849 ± 117   4814 ±  19   0.99  indistinguishable 
 cd/yklua/250           36434 ± 497  36292 ± 274   1.00  indistinguishable 
 mandelbrot/yklua/500    1170 ±   3   1170 ±   1   1.00  indistinguishable 
 havlak/yklua/1500      65648 ±2853  65650 ± 995   1.00  indistinguishable 
 deltablue/yklua/12000  10393 ± 118  10447 ± 177   1.01  indistinguishable 
 nbody/yklua/250000      5571 ±  56   5602 ± 263   1.01  indistinguishable 
 list/yklua/1500         9158 ± 541   9224 ± 530   1.01  indistinguishable 
 storage/yklua/1000     28098 ± 158  28330 ± 398   1.01  indistinguishable 
 queens/yklua/1000       6389 ± 177   6474 ± 400   1.01  indistinguishable 
 permute/yklua/1000      9793 ± 408   9962 ±1154   1.02  indistinguishable 

The change is insignificant when JIT is enabled.

Perf stats

Benchmark Functions yklua (main) yklua-fork (this change)
richards __ykrt_control_point@plt Runtime Overhead 1.43% 0%
richards __ykrt_control_point@plt Samples 78 0
havlak __ykrt_control_point@plt Runtime Overhead 0.80% 0%
havlak __ykrt_control_point@plt Samples 2950 0
lulpeg __ykrt_control_point@plt Runtime Overhead 1.47% 0%
lulpeg __ykrt_control_point@plt Samples 3408 0

Related ykllvm PR ykjit/ykllvm#300

@ltratt
Copy link
Copy Markdown
Contributor

ltratt commented Jan 31, 2026

Does this rely on https://github.com/ykjit/ykllvm/pulls or ... ?

@Pavel-Durov
Copy link
Copy Markdown
Contributor Author

Does this rely on https://github.com/ykjit/ykllvm/pulls or ... ?

Yes, it rely on PR ykjit/ykllvm#300 (in the description).

@ltratt
Copy link
Copy Markdown
Contributor

ltratt commented Feb 1, 2026

Please squash.

Reduce call overhead for yk controlpoint calls by eliminating PLT
indirection in llvm patchpoints.
@Pavel-Durov Pavel-Durov force-pushed the ykllvm-nonlazybind-control-point branch from db1ac65 to 5312013 Compare February 1, 2026 16:42
@Pavel-Durov
Copy link
Copy Markdown
Contributor Author

Pavel-Durov commented Feb 1, 2026

Squashed 5312013

@ltratt ltratt added this pull request to the merge queue Feb 1, 2026
Merged via the queue into ykjit:master with commit 944d416 Feb 1, 2026
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