Skip to content
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

Optimize the parsing of unquoted attributes #155

Merged
merged 1 commit into from
Nov 26, 2018

Conversation

stof
Copy link
Contributor

@stof stof commented Nov 24, 2018

Instead of handling each char one by one, we read them in batch until a char for which we need a special handling (chars ending the attribute value, references and chars needing to throw an error).

I ran the loading benchmark on a modified fixture file in which I unquoted all class attributes containing a single class (this kind of replacement was the easiest to do).

Before: 116.11662387848
After: 114.08836126328

There is no difference on the unmodified benchmark, because it uses quoted attributes everywhere.

@stof
Copy link
Contributor Author

stof commented Nov 24, 2018

note that this strategy of reading chars until the special ones is already used when reading quoted attribute values.

@goetas
Copy link
Member

goetas commented Nov 25, 2018

because of recent CS changes, this requires to be rebased

@stof
Copy link
Contributor Author

stof commented Nov 26, 2018

@goetas done

@goetas goetas merged commit 88b7c66 into Masterminds:master Nov 26, 2018
@goetas
Copy link
Member

goetas commented Nov 26, 2018

Thanks

@stof stof deleted the optimize_attributes branch November 26, 2018 18:00
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.

2 participants