Skip to content

Avoid excessive save/restore calls in parser - #9018

Open
anderseknert wants to merge 1 commit into
open-policy-agent:mainfrom
anderseknert:parser-fixes
Open

Avoid excessive save/restore calls in parser#9018
anderseknert wants to merge 1 commit into
open-policy-agent:mainfrom
anderseknert:parser-fixes

Conversation

@anderseknert

Copy link
Copy Markdown
Member

Previously we'd save and restore before we even knew if we needed to, meaning we'd allocate memory to prepare for parsing package and import statements with each statement parsed. This change fixes that, along with a few more parser improvements.

Also reduce the cost of parsing comments by using the same bytes from Comment.Text for Comment.Location.Text.

Previously we'd save and restore before we even knew if we needed
to, meaning we'd allocate memory to prepare for parsing `package`
and `import` statements with each statement parsed. This change
fixes that, along with a few more parser improvements.

Also reduce the cost of parsing comments by using the same bytes
from Comment.Text for Comment.Location.Text.

Signed-off-by: Anders Eknert <anders.eknert@apple.com>
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