-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Research on using custom stack instead of call-stack in Reader #35
Comments
Currently By a explicit state machine implementation(branch |
Progress report: Most of the functions have been implemented. Except that "May add a configurable limit of tree depth". I am considering adding a configurable limit on parsing stack size instead. The state transitions are through unittested. I also have a brief performance test for current implementation(36434b6). On a i5 2400, 4GB Windows 7 x64 machine, with release32 build: RapidJson.ReaderParse_DummyHandler_SSE42 (590 ms) I do not have a good explanation for these results. I guess change of memory access pattern may be the major cause. A significant change is that the iterative parser will push state to the internal stack( I tried to separate the state stack, but did not see any impact on performance. |
On an Intel(R) Core(TM) i7-3520M CPU @ 2.90GHz, Linux 64-bit, GCC 4.8, I see the following:
So it seems to be quite compiler-specific. (The ordering of the tests could be more convenient to compare the variants, though). |
Currently, ParseObject(), ParseArray() and ParseValue() will recursively call other parse functions. This has potential stack overflow problem if a JSON tree is very deep (maybe a synthesized JSON for security attack).
The text was updated successfully, but these errors were encountered: