Skip to content

Conversation

@Kocal
Copy link
Member

@Kocal Kocal commented Dec 5, 2025

Q A
Bug fix? yes
New feature? no
Deprecations? no
Documentation? no
Issues Fix #...
License MIT

Following #3218

On an app with ~3320 keys, ~2870 of them didn't use the ICU syntax. Early exiting when no { reduced the cache-clear time by ~60%:

@carsonbot carsonbot added Bug Bug Fix Status: Needs Review Needs to be reviewed labels Dec 5, 2025
@Kocal Kocal force-pushed the translator-perf-intl-params-extractor branch from 0559857 to c8a303c Compare December 5, 2025 18:24
@Kocal Kocal requested a review from Copilot December 5, 2025 18:34
@Kocal
Copy link
Member Author

Kocal commented Dec 5, 2025

Not sure if this must be considered as a bug or feature 🤔

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a performance optimization to the IntlMessageParametersExtractor by adding an early exit when messages don't contain ICU parameter syntax. The optimization skips expensive parsing for the ~86% of messages that don't use ICU MessageFormat parameters (indicated by the absence of {), resulting in a ~60% reduction in cache-clear time.

  • Early return added to avoid parsing messages without parameters
  • Optimization based on the fact that all ICU MessageFormat parameters use { as the opening delimiter
  • No functional changes - only performance improvement

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Kocal Kocal merged commit 048fc45 into symfony:2.x Dec 5, 2025
33 of 35 checks passed
@Kocal Kocal deleted the translator-perf-intl-params-extractor branch December 5, 2025 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Bug Fix Performance Status: Needs Review Needs to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants