Closed soteras closed 4 years ago
Unfortunately, I'm afraid that extracting the options and allocating the funs on each element is going to kill the performance completely. In this library in particular performance is far more important than ease of maintenance. That said, I haven't actually benchmarked it, it might be fine - loosing 1 to 2% would be ok, anything more is probably prohibitive.
Is there a way to benchmarked it?
There are benchmarks in the bench
folder with some instructions in the README.
I run some trimmed down version of the full benchmark and right now it seems that on object-heavy JSON this PR is about 4-7% slower than current master without strict decoding.
Given no changes in status of this PR for over a year, I'm going to close it. If there's a desire to pick up the work again, please re-open this with the required changes & benchmark data.
86
I've refactor Decode module, because when I tried to add new opt is was very difficult because all functions add key_decode, string_decode and I would have to refactor all functions, now It's ease to add new options.
I added strict option on decode because I need to know when my JSON has duplicated keys.