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

[sui-json-rpc] Use more efficient parser #4306

Merged
merged 2 commits into from
Aug 29, 2022
Merged

Conversation

tnowacki
Copy link
Contributor

  • Use the newer parser for Moves type tags
  • This should improve performance as the newer parser doesn't allocate as much (it doesn't copy out each intermediate string)

- Use the newer parser for Moves type tags
@sblackshear
Copy link
Collaborator

@tnowacki
Copy link
Contributor Author

@velvia
Copy link
Contributor

velvia commented Aug 26, 2022

LGTM, but I guess this is just switching the libraries or functions used. I'm curious about the details of those libraries, but will trust you here. :)

@tnowacki
Copy link
Contributor Author

LGTM, but I guess this is just switching the libraries or functions used. I'm curious about the details of those libraries, but will trust you here. :)

A quick summary: The original parser for type tags copied each substring while tokenizing. The new parser just creates sub-string references. You can think about it as generating a Iterator<(Tok, String)> vs Iterator<(Tok, &str)>

@tnowacki tnowacki merged commit 5ad8a9c into MystenLabs:main Aug 29, 2022
@tnowacki tnowacki deleted the parser branch August 29, 2022 20:16
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.

3 participants