PMJSON icon indicating copy to clipboard operation
PMJSON copied to clipboard

Make decoder non-recursive

Open lilyball opened this issue 9 years ago • 1 comments

A recursive decoder means we can't decode arbitrarily-deep JSON hierarchies. If we switch to storing our decoding state in an array instead of on the stack, we can remove this limitation.

Note: Test performance to make sure that using an array doesn't noticeably slow down the decoder.

lilyball avatar Oct 27 '16 06:10 lilyball

I'm not sure this really matters. The current default cap is a depth of 10,000, and it seems rather unlikely to have real-world JSON that even hits this cap, let alone needs more. The motivation for this issue is largely the fact that I'd like to not need a cap at all, but I suspect a non-recursive decoder would be sufficiently complicated so as not to be worth the effort.

lilyball avatar Nov 09 '16 01:11 lilyball