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

extphprs / ext-php-rs / 24421185838
66%
master: 66%

Build:
Build:
LAST BUILD BRANCH: dependabot/github_actions/nhedger/setup-mago-2
DEFAULT BRANCH: master
Ran 14 Apr 2026 08:29PM UTC
Jobs 1
Files 95
Run time 1min
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

14 Apr 2026 08:25PM UTC coverage: 66.211% (-0.09%) from 66.299%
24421185838

push

github

ptondereau
perf: pre-compute mangled property names in get_properties

The get_properties handler (called by var_dump, print_r, json_encode,
serialization) was calling format!() per property per invocation to
build PHP-convention mangled names. This allocated on every call.

PHP itself computes mangled names once at class registration time
(zend_mangle_property_name in zend_compile.c) and reuses them forever.

This commit brings the same approach:
- Field properties: the proc macro emits the mangled name as a
  compile-time string literal in PropertyDescriptor. Zero runtime cost.
- Method properties: mangled names are computed once on first access
  and cached in ClassMetadata via OnceCell. One allocation per class
  for the entire process lifetime.
- get_properties handler reads pre-computed names instead of format!().

Benchmark results (callgrind, 100k iterations):
  property_dump: -21.4% instructions, -20.0% estimated cycles
  property_read: +1.4% (struct size overhead, acceptable)
  property_write: +1.6% (struct size overhead, acceptable)

6 of 34 new or added lines in 3 files covered. (17.65%)

8426 of 12726 relevant lines covered (66.21%)

33.36 hits per line

Uncovered Changes

Lines Coverage ∆ File
15
12.77
-2.42% src/class.rs
13
0.0
0.0% src/zend/handlers.rs
Jobs
ID Job ID Ran Files Coverage
1 24421185838.1 14 Apr 2026 08:29PM UTC 95
66.21
GitHub Action Run
Source Files on build 24421185838
  • Tree
  • List 95
  • Changed 4
  • Source Changed 4
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #24421185838
  • eccf8c6c on github
  • Prev Build on master (#24409406846)
  • Next Build on perf/precompute-mangled-property-names (#24421322317)
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