Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Optimize contract class hashing #832

Open
3 tasks
juanbono opened this issue Jul 18, 2023 · 0 comments
Open
3 tasks

Optimize contract class hashing #832

juanbono opened this issue Jul 18, 2023 · 0 comments

Comments

@juanbono
Copy link
Collaborator

juanbono commented Jul 18, 2023

Consider using mini-serde.

Another option is to use a tokenizer. The complete parsing process is not necessary for reformatting, while at the same time is one of the major costs involved. If you can get as far as producing tokens such as identifier, number, colon, you can directly output the reformatted string incrementally while processing.
A small amount of parsing may and a little structuring may still be necessary if we need to sort fields, but it should go much further than identifying objects (identifier + colon + value) and saving them in a Vec.
There are several fast tokenizers available, some in pure Rust, but also simd_json by Daniel Lemire or the one made for jsonptr in WUFFS. I think there's already a wrapper for simd_json, while jsonptr would require us to make our own.

Tasks

  • optimize cairo 0 contract classes.
  • optimize casm contract classes.
  • optimize sierra contract classes.
@juanbono juanbono added this to the Improvements milestone Jul 18, 2023
@juanbono juanbono moved this to Backlog in Starknet Jul 18, 2023
@juanbono juanbono moved this from Backlog to Todo in Starknet Sep 5, 2023
@igaray igaray moved this from Todo to Backlog in Starknet Jan 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Status: Backlog
Development

No branches or pull requests

1 participant