-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Performance issue with the "lint:xliff" command #27564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This PR was merged into the 2.0.x-dev branch. Discussion ---------- Disable the linting of XLIFF files More details at this issue: symfony/symfony#27564 Commits ------- 0575f17 Disable the linting of XLIFF files
if we cannot make the function faster, we could at least output some progress bar so that Travis doesn't think we're frozen. |
next step would be to profile the C code then. |
It appears that the W3C intentionally imposes a delay on the loading of DTDs, as seen here : https://www.w3.org/Help/Webmaster
We can improve performances by loading http://www.w3.org/2001/xml.xsd in local file system with |
OK, found the issue there. The XliffFileLoader has some special logic to use a local copy of the xml schema when validating the schema. But the XliffLintCommand does not use that logic (and so uses the remote copy). We should use the same logic in both cases (we could extract the |
Btw, the XliffLintCommand is also missing support for xliff 2.0 (unlike the loader). It does not select the schema. |
Suggestion: extract a Xliff (internal) utility, which would allow reusing both the version detection and the schema processing |
…ff command (javiereguiluz) This PR was squashed before being merged into the 4.2-dev branch (closes #27653). Discussion ---------- [Translation] Improved the performance of the lint:xliff command | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #27564 | License | MIT | Doc PR | - As suggested by @stof I extracted the schema validation logic from XliffFileLoader to reuse it in the `lint:xliff` command. The validation is now instantaneous, so the command is blazing fast! Commits ------- e53bf58 [Translation] Improved the performance of the lint:xliff command
This PR was merged into the 4.1 branch. Discussion ---------- [Translation] fix perf of lint:xliff command | Q | A | ------------- | --- | Branch? | 4.1 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #27564 | License | MIT | Doc PR | - #27653 has been merged on master as an improvement, but the perf issue is a killer. Our CI spends 1 minutes on just a few translation test cases. Only 4.1 has this behavior. That's a bug. Commits ------- 02c69b1 [Translation] fix perf of lint:xliff command
Symfony version(s) affected: all
Description
The
lint:xliff
command is too slow.How to reproduce
I put the following on my Travis CI config:
$ ./tests/bin/console lint:xliff "src/Resources/translations"
But the build runs out of time (see full details):
Additional context
I've run this command locally linting just 1 file and it was extremely slow. I share the Blackfire profile:
Profile:
https://blackfire.io/profiles/5f1be513-3f01-414d-8759-11ae84a00ce3/graph
The problem seems to be in PHP's
DOMDocument::schemaValidate
but maybe we are doing something that makes it slow?The text was updated successfully, but these errors were encountered: