-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
Bug 63520 is still not fixed.
We have 2 alternative extensions
-
- jsonc the older one, probably not perfect, but used in a lot of
downstream distributions
- jsonc the older one, probably not perfect, but used in a lot of
-
- jsond the recent one
I think it is time to switch ext/json to another implementation and so
make PHP really "free" again.
Remi.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iEYEARECAAYFAlQ6HLkACgkQYUppBSnxahg3tACgi3DVjPpK3bN9fbiPLsV2QZfj
asAAmQF/3cvlnhut/nOQIZVBd9kbQiJq
=au/C
-----END PGP SIGNATURE
Hi,
We have 2 alternative extensions
- jsonc the older one, probably not perfect, but used in a lot of
downstream distributions
- jsond the recent one
I think it is time to switch ext/json to another implementation and so
make PHP really "free" again.
I think that we should have a proper benchmarks of both alternatives before
we make that decision. I have been already working on it for some time. I'm
almost done with a generator that generates json files based on defined
templates. I need to add more templates and experiment with it a bit more.
The decoders/encoders behaves differently for different json instances.
It's very important to test as many instances as possible to minimize
chance of any regression. I think that I'll be able to provide some numbers
in the next few months. I would like to benchmark current json, jsond as
well as jsonc.
Just a quick update on jsond. The decoder is mostly done. I have been
recently working on optimization for the encoder. I already have over 30%
speed improvement in encoding for string based arrays/objects like
$_SERVER. It's generally much faster now but there is still a big room for
other impromevents. I also experiment with a new buffer (replacement for
smart_str in json encoder). It needs lots of optimization but it already
gives better numbers for some cases. However it also gives worse numbers
for some other cases like processing small integers so I need to play with
it a bit more. As I said before I need a better set of benchmarks to be
sure that it works fine for a big number of json instances.
Cheers
Jakub
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Le 13/10/2014 22:15, Jakub Zelenka a écrit :
Hi,
We have 2 alternative extensions
- jsonc the older one, probably not perfect, but used in a lot
of downstream distributions
- jsond the recent one
I think it is time to switch ext/json to another implementation
and so make PHP really "free" again.I think that we should have a proper benchmarks of both
alternatives before we make that decision. I have been already
working on it for some time. I'm almost done with a generator that
generates json files based on defined templates. I need to add more
templates and experiment with it a bit more. The decoders/encoders
behaves differently for different json instances. It's very
important to test as many instances as possible to minimize chance
of any regression. I think that I'll be able to provide some
numbers in the next few months. I would like to benchmark current
json, jsond as well as jsonc.
The main issue is the "non-free" decoder.
Of course perf can be considered as an issue (I think minor).
jsonc have bad perf, but is free.
If jsond have nearly same perf than old one, it's enough.
Just a quick update on jsond. The decoder is mostly done.
So, please go on.
I have been recently working on optimization for the encoder. I
already have over 30% speed improvement in encoding for string
based arrays/objects like $_SERVER. It's generally much faster now
but there is still a big room for other impromevents. I also
experiment with a new buffer (replacement for smart_str in json
encoder). It needs lots of optimization but it already gives better
numbers for some cases. However it also gives worse numbers for
some other cases like processing small integers so I need to play
with it a bit more. As I said before I need a better set of
benchmarks to be sure that it works fine for a big number of json
instances.
Current encoder is not an issue.
Perf. can be manage later.
And I don't think we should use another string management for json
encoder, so if improvment is possible, should go in smart_str.
Remi.
Cheers
Jakub
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iEYEARECAAYFAlSH63wACgkQYUppBSnxahjv2gCfQZLjrjrfjKuFk69vanf7IJbl
K+0An2/cikV5DqTeyPGtlUxX6uScZewl
=0VlE
-----END PGP SIGNATURE
Hi,
The main issue is the "non-free" decoder.
Agreed.
Of course perf can be considered as an issue (I think minor).
jsonc have bad perf, but is free.If jsond have nearly same perf than old one, it's enough.
My initial benchmarks (for PHP5 jsond ext) actually shows better
performance for json instances containing strings. Pure int and floats are
more or less the same. But need more benchmarks to confirm that.
Just a quick update on jsond. The decoder is mostly done.
So, please go on
I have ported a decoder to PHP 7. The code can be found on my github
php-src jsond branch ( for code changes see
https://github.com/bukka/php-src/compare/jsond ). It's just a replaced
decoder. The encoder is the same though. All tests are passing for me... I
haven't done any perf tests as yet. There is a big room for improvements
but it's a good start IMHO.
I'll have more time during Christmas so I would like to improve the code
and do some benchmarks. Think we could have RFC around New Year...
I have been recently working on optimization for the encoder. I
already have over 30% speed improvement in encoding for string
based arrays/objects like $_SERVER. It's generally much faster now
but there is still a big room for other impromevents. I also
experiment with a new buffer (replacement for smart_str in json
encoder). It needs lots of optimization but it already gives better
numbers for some cases. However it also gives worse numbers for
some other cases like processing small integers so I need to play
with it a bit more. As I said before I need a better set of
benchmarks to be sure that it works fine for a big number of json
instances.Current encoder is not an issue.
Perf. can be manage later.And I don't think we should use another string management for json
encoder, so if improvment is possible, should go in smart_str.
Yeah I won't go there (replacing smart_str). It's still experimental and it
would delay the whole thing quite a lot. I'll rather add just few proven
improvements that are already done in jsond and that are not breaking ABI.
Cheers
Jakub
I don’t know if you are interested in some other open source projects that parse JSON, but have you looked at the decoder here?
https://github.com/vstakhov/libucl https://github.com/vstakhov/libucl
It can parse more than just the JSON format - but it has some JSON benchmarks attached and works really well - and is plain C.
Am 14.12.2014 um 20:38 schrieb Jakub Zelenka bukka@php.net:
Hi,
The main issue is the "non-free" decoder.
Agreed.
Of course perf can be considered as an issue (I think minor).
jsonc have bad perf, but is free.If jsond have nearly same perf than old one, it's enough.
My initial benchmarks (for PHP5 jsond ext) actually shows better
performance for json instances containing strings. Pure int and floats are
more or less the same. But need more benchmarks to confirm that.Just a quick update on jsond. The decoder is mostly done.
So, please go on
I have ported a decoder to PHP 7. The code can be found on my github
php-src jsond branch ( for code changes see
https://github.com/bukka/php-src/compare/jsond ). It's just a replaced
decoder. The encoder is the same though. All tests are passing for me... I
haven't done any perf tests as yet. There is a big room for improvements
but it's a good start IMHO.I'll have more time during Christmas so I would like to improve the code
and do some benchmarks. Think we could have RFC around New Year...I have been recently working on optimization for the encoder. I
already have over 30% speed improvement in encoding for string
based arrays/objects like $_SERVER. It's generally much faster now
but there is still a big room for other impromevents. I also
experiment with a new buffer (replacement for smart_str in json
encoder). It needs lots of optimization but it already gives better
numbers for some cases. However it also gives worse numbers for
some other cases like processing small integers so I need to play
with it a bit more. As I said before I need a better set of
benchmarks to be sure that it works fine for a big number of json
instances.Current encoder is not an issue.
Perf. can be manage later.And I don't think we should use another string management for json
encoder, so if improvment is possible, should go in smart_str.Yeah I won't go there (replacing smart_str). It's still experimental and it
would delay the whole thing quite a lot. I'll rather add just few proven
improvements that are already done in jsond and that are not breaking ABI.Cheers
Jakub
Hi Kevin,
I don’t know if you are interested in some other open source projects that parse JSON, but have you looked at the decoder here?
https://github.com/vstakhov/libucl https://github.com/vstakhov/libucl
It can parse more than just the JSON format - but it has some JSON benchmarks attached and works really well - and is plain C.
That isn’t a JSON parser, it parses its own format which seems to be a superset of JSON.
Also, we really need something custom-tailored to PHP’s needs (i.e. produces PHP types).
Thanks.
Andrea Faulds
http://ajf.me/
Hi,
Hi,
On Wed, Dec 10, 2014 at 6:43 AM, Remi Collet remi@fedoraproject.org
wrote:So, please go on
I have ported a decoder to PHP 7. The code can be found on my github
php-src jsond branch ( for code changes see
https://github.com/bukka/php-src/compare/jsond ). It's just a replaced
decoder. The encoder is the same though. All tests are passing for me... I
haven't done any perf tests as yet. There is a big room for improvements
but it's a good start IMHO.I'll have more time during Christmas so I would like to improve the code
and do some benchmarks. Think we could have RFC around New Year...
Just a quick update. I have drafted rfc ( https://wiki.php.net/rfc/jsond ).
I'll soon announce it and put it under the discussion. I just need to
finalize benchmarks. I have been working on it (
https://github.com/bukka/php-jsond-bench ) quite extensively in the past
few weeks and it's almost done. Hopefully I'll announce it in the next few
weeks.
Cheers
Jakub