• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

extphprs / ext-php-rs
34%
master: 65%

Build:
Build:
LAST BUILD BRANCH: fix/github-templates
DEFAULT BRANCH: master
Repo Added 29 Oct 2025 05:59AM UTC
Files 89
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

LAST BUILD ON BRANCH perf/zend-string-init-fast
branch: perf/zend-string-init-fast
CHANGE BRANCH
x
Reset
  • perf/zend-string-init-fast
  • 102_refs
  • 138_inheritance
  • 173_simple_extends_and_implements
  • 176_getter_test
  • 182_objects_in_props
  • 184_missing_property_types_in_stubs
  • 186_stubs_constants
  • 191_zend_callable
  • 199_union_intersection_dnf
  • 237_zval_flags
  • 252_static_props_and_methods
  • 310_performance
  • 325_static_str
  • 369_better_stubs
  • 424_zval_heap_corruption
  • 492_lit_suffixes_in_defaults
  • 493_feat_sets_in_arguments
  • 499_document_superglobals
  • 502_returning_self
  • 508_php_write
  • 515_ref_mutability
  • 518_cargo_php_install
  • 522_indexmap
  • 523_custom_allocator_and_stubs
  • 525_zend_ht_entry
  • 536_identifiers
  • 537_zend_bailout
  • 538_nullable_param
  • 590_interfaces
  • 599-add-performance-test-infrastructure
  • abstract_methods
  • add-grpc-php-rs
  • add-sapi-send-headers
  • add-sapi-zts-test
  • cargo_watch
  • chore/add-coc
  • chore/bump-edition-2024
  • chore/cargo-php-stubs-tests
  • chore/context7
  • chore/php-8-5
  • chore/php-86-nightly
  • ci/musl
  • ci/zts-embed
  • customize-guide-logo
  • dependabot/cargo/convert_case-0.10.0
  • dependabot/cargo/convert_case-0.11.0
  • dependabot/cargo/convert_case-0.9.0
  • dependabot/cargo/darling-0.23
  • dependabot/cargo/libloading-0.9
  • dependabot/cargo/zip-7.0
  • dependabot/cargo/zip-8.0
  • dependabot/github_actions/JamesIves/github-pages-deploy-action-4.7.4
  • dependabot/github_actions/JamesIves/github-pages-deploy-action-4.7.6
  • dependabot/github_actions/JamesIves/github-pages-deploy-action-4.8.0
  • dependabot/github_actions/actions/cache-5
  • dependabot/github_actions/actions/checkout-6
  • dependabot/github_actions/docker/build-push-action-7
  • dependabot/github_actions/docker/setup-buildx-action-4
  • docs/move-showcase-to-awesome
  • embed-zts
  • feat/cargo-llvm-cov
  • feat/embed-php-code
  • feat/error-observer
  • feat/interface_impl
  • feat/observer-api
  • feat/zend-extension
  • feat/zero-alloc-fast-path
  • feat_immutable_empty_array
  • feat_zval_coercion
  • fix-valid-method-name
  • fix/bencher-host
  • fix/binary-return-memory-leak
  • fix/cargo-php-install-musl
  • fix/ci-badge-workflow-reference
  • fix/clang-arm64-preserve-none
  • fix/clippy--
  • fix/clippy-1-93-0
  • fix/clippy-hasher
  • fix/clippy-rust-1-91
  • fix/cloning-class
  • fix/deploy-doc
  • fix/disable-zts-embed
  • fix/github-templates
  • fix/mock-unint
  • fix/musl-8-5-build
  • fix/parking-lot-min-version
  • fix/releaze-plz-workflow
  • fix/releaze-plz-workflow-permission
  • fix/segfault-empy-array
  • fix/use-fork-bindgen
  • fix/windows-bindgen-nommx
  • fix/windows-dev-pack
  • fix_prop_visibility
  • fix_stub_gen
  • hotload
  • json_serializable
  • lazy
  • master
  • named_arguments
  • patch-1
  • readonly_class
  • release-plz-2025-10-29T06-23-17Z
  • release-plz-2025-10-29T13-44-17Z
  • release-plz-trigger
  • release-plz-trigger-v2
  • release-plz-trigger-v3
  • remove-php80-testing
  • showcase
  • smartstring
  • trusted-publishing

29 Mar 2026 07:32PM UTC coverage: 34.103% (+0.04%) from 34.063%
23717260177

Pull #701

github

ptondereau
perf: use `zend_string_init_fast()` for non-persistent strings

Eliminate heap allocations for empty and single-character PHP strings by
routing non-persistent allocations through `zend_string_init_fast()`,
which returns PHP's pre-allocated interned globals (`zend_empty_string`
and `zend_one_char_string[256]`) instead of calling `emalloc`.

Available since PHP 8.0, `zend_string_release()` is a no-op on interned
strings (`ZSTR_IS_INTERNED` guard), so `ZBox::drop()` remains safe with
no Rust-side ownership changes needed.

The interned string globals are declared as weak symbols via
`#pragma weak` so the extension `.so` can be loaded outside of PHP
(e.g. by `cargo-php stubs`). When the globals are unavailable or
uninitialized, the fast path is skipped and `zend_string_init()` is
used as fallback.

Also fix `set_zend_string()` to detect interned strings via
`GC_IMMUTABLE` and set `InternedStringEx` type flags instead of
`StringEx`. Without this, PHP's debug build asserts when destroying
interned strings stored in zvals marked as refcounted. This fixes 4
pre-existing integration test failures on debug PHP builds.
Pull Request #701: perf: use zend_string_init_fast() for non-persistent strings

5 of 5 new or added lines in 1 file covered. (100.0%)

2215 of 6495 relevant lines covered (34.1%)

23.76 hits per line

Relevant lines Covered
Build:
Build:
6495 RELEVANT LINES 2215 COVERED LINES
23.76 HITS PER LINE
Source Files on perf/zend-string-init-fast
  • Tree
  • List 92
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
23717260177 perf/zend-string-init-fast perf: use `zend_string_init_fast()` for non-persistent strings Eliminate heap allocations for empty and single-character PHP strings by routing non-persistent allocations through `zend_string_init_fast()`, which returns PHP's pre-allocated intern... Pull #701 29 Mar 2026 07:36PM UTC ptondereau github
34.1
23717261057 perf/zend-string-init-fast Merge bd30bf7a5 into 6b2a61038 Pull #701 29 Mar 2026 07:35PM UTC web-flow github
34.1
23717201024 perf/zend-string-init-fast perf: use `zend_string_init_fast()` for non-persistent strings Eliminate heap allocations for empty and single-character PHP strings by routing non-persistent allocations through `zend_string_init_fast()`, which returns PHP's pre-allocated intern... push 29 Mar 2026 07:32PM UTC ptondereau github
34.1
23717201919 perf/zend-string-init-fast Merge 2b8a7a0a1 into 6b2a61038 Pull #701 29 Mar 2026 07:32PM UTC web-flow github
34.1
See All Builds (808)
  • Repo on GitHub
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc