Skip to content

Reuse Unicode case analysis when normalizing name parts - #15

Merged
iliaal merged 1 commit into
masterfrom
simplify/share-camelcase-analysis
Oct 10, 2026
Merged

iliaal merged 1 commit into
masterfrom
simplify/share-camelcase-analysis

Conversation

@iliaal

@iliaal iliaal commented Oct 10, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Analyze the case shape once when detecting mixed-case name parts, instead of calling upper/lower predicates that each repeat the same Unicode analysis.
  • Preserve the existing 1,024-byte guard, combining-mark stripping, case-transition rule, and long-token fallback.
  • Add six regression cases covering uppercase, uncased scripts, an uncased prefix, decomposed accents, punctuation, and empty input.

Benefit

Removes a redundant letters extraction and upper/lower conversion for non-uppercase parts within the guard. A focused PHP 8.4.26 benchmark normalizing 400,000 fresh surname parts across eight ASCII/Unicode inputs took 804–909 ms before and 684–757 ms after in five paired runs. This is a normalization microbenchmark, not an end-to-end parser throughput claim.

Validation

  • PHPUnit: 1,203 tests / 3,109 assertions passed with the 256 MiB limit.
  • PHPStan level 9 and PHP 8.5 compatibility analysis passed.
  • PHP CS Fixer dry run, 69 PHP syntax checks, Composer audit, baseline/README/deprecation guards, and diff checks passed.
  • Independent review found no behavior regressions.
  • All 84 remote file entries (paths, modes, blob hashes) match the tested tree, verified by complete NUL-delimited Git tree comparison before PR creation. Tree: 1983afc3fe3659f81f9ffaa8efed47de20538491.

Exact-head CI passed all five jobs: PHP 8.3 / 8.4 / 8.5 tests (including Composer audit), static analysis (including the PHP 8.5 compatibility gate), and code style. No jobs or steps were skipped.

@iliaal
iliaal merged commit b135002 into master Oct 10, 2026
5 checks passed
@iliaal
iliaal deleted the simplify/share-camelcase-analysis branch October 10, 2026 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant