8000 Yaml\Parser isBlockScalarHeader is slow · Issue #27960 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Yaml\Parser isBlockScalarHeader is slow #27960

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

Closed
staabm opened this issue Jul 16, 2018 · 4 comments
Closed

Yaml\Parser isBlockScalarHeader is slow #27960

staabm opened this issue Jul 16, 2018 · 4 comments

Comments

@staabm
Copy link
Contributor
staabm commented Jul 16, 2018

Symfony version(s) affected: 3.4.11

Description
when parsing yaml files the method Yaml\Parser::isBlockScalarHeader is oftentimes on the hotpath, because doing a lot of preg_match calls.

see
grafik

would it make sense to do a cheaper fast-fail check before actually invoking the regex-engine?

I do not have yet a proper feeling of what this method is trying to check and why, so my suggestion might be rubbish.

@xabbuh xabbuh added the Yaml label Jul 16, 2018
@xabbuh
Copy link
Member
xabbuh commented Jul 27, 2018

Can you show an example YAML file that shows this or a similar profile?

@xabbuh
Copy link
Member
xabbuh commented Aug 1, 2018

Can you check if #28106 improves the situation?

fabpot added a commit that referenced this issue Aug 2, 2018
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Yaml] save preg_match() calls when possible

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | possibly #27960
| License       | MIT
| Doc PR        |

Commits
-------

e6bea97 save preg_match() calls when possible
@staabm
Copy link
Contributor Author
staabm commented Aug 2, 2018

I will double check on the weekend.

@staabm
Copy link
Contributor Author
staabm commented Aug 5, 2018

It looks like my issue was solved, thx

@staabm staabm closed this as completed Aug 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants
0