Skip to content

perf: ZTS: move AG and SCNG into native __thread storage, replay of #22231#22595

Open
henderkes wants to merge 1 commit into
php:masterfrom
henderkes:perf/native_tls
Open

perf: ZTS: move AG and SCNG into native __thread storage, replay of #22231#22595
henderkes wants to merge 1 commit into
php:masterfrom
henderkes:perf/native_tls

Conversation

@henderkes

Copy link
Copy Markdown
Contributor

So I largely copied the approach of #22231, but this time for AG and SCNG, because they're small in size (256 bytes, so we don't step back into the TLS surplus issue) and I don't need to touch the JIT.

EG and CG are "fine" to keep in the heap storage with the const offsets, because EG is mostly hot in dispatch and the __thread symbol is already kept loaded in the hybrid VM. For clang compile-heavy code still suffers a bit from tsrm_ls_cache base reloads, but I'm still brainstorming for that.

This mostly benefits the lexer and allocations.

@arnaud-lb

@henderkes henderkes requested review from bukka and dstogov as code owners July 4, 2026 14:37
@henderkes henderkes force-pushed the perf/native_tls branch 2 times, most recently from 3a4c35a to 31eb0f9 Compare July 4, 2026 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant