Skip to content

Conversation

bukka
Copy link
Member

@bukka bukka commented May 11, 2016

This PR introduces overloading of JSON parsing using callback methods. The initial version was provided by Andrey Hristov and I have done some improvements and API changes into it. The result is an exporting of JSON parser to other extension and no impact on the performance of the current parser. At least my tests didn't show up any visible slowdown with this embed version:

Summary: https://github.com/bukka/php-jsond-bench/blob/master/reports/0002/summary.md
Actual results: https://github.com/bukka/php-jsond-bench/blob/master/reports/0002/runs.md

I think it's ready to go to master. Just creating this PR to check Travis and let others look at it and possibly comment on it.

bukka added 7 commits April 10, 2016 15:35
This commit is just a slight modification (renaming and some small
changes) of the patch that has been provided by Andrey Hristov.
It adds support for hooking of the json parser operations and
allows re-using of modified JSON parsing outside of json ext.
@nikic
Copy link
Member

nikic commented May 11, 2016

What's the intended use case here?

@bukka
Copy link
Member Author

bukka commented May 11, 2016

Re-using parser in other extensions. Specifically Andrey is working on a feature for mysqlnd that will use it with its own logic. There might be more use cases for other extensions that need custom json parsing.

In addition it could be a good base for json schema validatio / object serialization where would be posible to use different parser methods for that without having perf impact on the default parsing.

@php-pulls php-pulls merged commit 0a0e42d into php:master May 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants