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

json2: new decoder2 part 1 #22545

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

enghitalo
Copy link
Contributor

@enghitalo enghitalo commented Oct 16, 2024

This is a part of json2 decoder2 rewriting in https://github.com/enghitalo/v/tree/json2/decode2-precalc-and-validation
It was splitted to help in review

This fraction is related to:

  • new json cheking
  • v type checking
  • new decoding strategy using ValueInfo

OBS: I am thinking about split the already done work in around 5 parts. What not means this work is done

benchmark keeps great
image

./v -prod crun vlib/x/json2/decoder2/tests/bench.v                          ─╯
 SPENT    35.895 ms in old_json.decode(Stru, json_data)!

 SPENT    12.861 ms in decoder2.decode[StructType[string]](json_data1)!
 SPENT     9.902 ms in old_json.decode(StructType[string], json_data1)!

 SPENT    13.673 ms in decoder2.decode[StructTypeOption[string]](json_data1)!
 SPENT    11.536 ms in old_json.decode(StructTypeOption[string], json_data1)!

 SPENT    15.311 ms in decoder2.decode[map[string]string](json_data1)!
 SPENT    29.128 ms in old_json.decode(map[string]string, json_data1)!

@enghitalo enghitalo changed the title json2: (decoder2) split part 1 json2: new decoder2 part 1 Oct 17, 2024
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