travisstaloch / simdjzon

simdjson port to zig

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

possible api improvements

travisstaloch opened this issue · comments

Ideas from sasuke420 discussion on discord:

  • an option to not care about the LSB of doubles
  • an option to store some numbers in 1 slot instead of 2, if they fit
  • an option to store some decimals exactly using some weird format including the base 10 exponent instead of as doubles, also in 1 slot
  • an option to be willing to parse numbers out of strings, if the person who made the json was a trickster who put them inside of string literals, but they are still actually numbers
  • 3 different options to assume fields will be in order and give nonsense results if they are not, assume fields will be in order and fall back to the current behavior if they are not, or use the current behavior (only affects parsing of structs)

i started working on task 4 (parse numbers out of strings) above today in 00cb22e @sharpobject since you originally suggested this, maybe let me know if you have any thoughts about how to improve it.

i'm about to test this out in simdjzon-rpc where i need it for parsing 'id' fields which may be strings or integers. i'm thinking this will be an improvement over std.fmt.parseInt() which i'm currently using in that project.