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

KarpelesLab / goro / 25828189816

13 May 2026 09:44PM UTC coverage: 52.285% (+40.2%) from 12.12%
25828189816

push

github

MagicalTux
perf: cache ZNULL ZVal wrapper and speed up spl_object_hash (bug60598)

bug60598 creates 10k objects in a loop, each calling
spl_object_hash twice (\$containers[hash] = \$this in __construct,
\$containers[hash] = NULL in __destruct). Two changes shave ~20% off
wall time so the test fits in the 15s execution-time limit:

- ZNull.ZVal() returns a cached *ZVal instead of allocating a fresh
  wrapper per call. SetString/SetInt already use pointer-replacement
  for non-ref entries so the cached instance never gets mutated.
  Matches the existing zFalseZVal/zTrueZVal/smallIntZVals scheme.
- splObjectHash builds its 32-char zero-padded hex string manually
  instead of going through fmt.Sprintf, which dominated the per-call
  cost in tight loops.

Local timing on bug60598.phpt: 11.5s → 9.2s.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

18 of 18 new or added lines in 2 files covered. (100.0%)

14 existing lines in 2 files now uncovered.

60608 of 115918 relevant lines covered (52.29%)

766054.11 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

55.25
/core/vm/ops_array.go


Source Not Available

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