Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

runtime: Linux handle-stack operations are out-of-line cold TLS calls (makes callers cold)

Aperta
#12,641 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
15/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
linux, rust

Direzione di ricerca

Start at hot_if_published() and runtime_handle_stack_cold, the out-of-line Linux path that wraps a LocalKey::with TLS access, and compare it with the Darwin aarch64 path that stays inline. Then check the callers call_vtable_method_value, call_vtable_method_with_private_brand and call_class_object_constructor_entry to see how the cold inference reaches them. Done means handle operations no longer compile to a call on Linux, with callgrind and A/B numbers that match or beat the trial branch; the payload does not say which of the two fix options is preferred.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

performance

On Linux, every runtime-handle stack operation goes out of line: hot_if_published() always returns None there, so each push/pop/height read calls runtime_handle_stack_cold (#[cold], a TLS access through LocalKey::with).

Two costs follow:

  1. one out-of-line TLS call per handle operation, which is where tsc's remaining ~+0.1% after #12631 comes from (callgrind, x86-64-v3 builds: before #12631 11.7562G, main 11.7667G);
  2. LLVM infers cold for every function that opens a handle scope, including call_vtable_method_value, call_vtable_method_with_private_brand and call_class_object_constructor_entry. Their callers then inline them under the cold-callee threshold (45) instead of 250. Since #12631, call_vtable_method_with_private_brand (cost 75) is no longer inlined at its two constructor callers.

A trial (branch kept as a bundle on the build host, head 2f54047026) moved private brands onto the handle stack and kept #[cold] only on Darwin aarch64. Quick A/B (n=3): zodwork −0.14%, fastify_inject −0.30%, tscwork +0.02% vs main, .text +55–60 KB, m_newcls +2%. The underlying fix is to give Linux the same published hot path for the handle stack (or an inline TLS access) that Darwin aarch64 has, so handle operations stop being calls and stop making their callers cold.

Follow-up of #12634 (closed: the private-brand stack was not the cause).

Lingua principale
Rust
Stelle
4.9k
Fork
166
Merge medio
2h 15m
PR unite (30g)
917

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di PerryTS/perry

Tutte le issue di PerryTS/perry

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.