simdjzon icon indicating copy to clipboard operation
simdjzon copied to clipboard

possible api improvements

Open travisstaloch opened this issue 2 years ago • 1 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
  • [x] 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)

travisstaloch avatar Jun 15 '22 03:06 travisstaloch

i started working on task 4 (parse numbers out of strings) above today in 00cb22ef5aa9025e295275fbd1c4cdf8f3340a3b @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.

travisstaloch avatar Oct 16 '23 00:10 travisstaloch