Re: New JSON parser

From: Date: Sun, 30 Mar 2014 18:17:42 +0000
Subject: Re: New JSON parser
References: 1  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message

On 13.03.2014, at 20:48, Jakub Zelenka <[email protected]> wrote:

> Hi,
> 
> I have create a new JSON parser using conditional re2c and pure pull Bison
> parser. It's a native UTF-8 parser licensed under PHP license (it can be
> used for Evil though :) ). The extension is available at
> 
> https://github.com/bukka/php-jsond
> 
> The encoder is taken from the current ext/json but the decoder has been
> completely rewritten.

While looking at this code I noticed that the encoder also does a UTF-8 -> UTF-16 conversion that
can be avoided. I've written a patch to avoid doing so: https://github.com/php/php-src/pull/636 

The performance improvement is not as awesome as jsond, just 15-30%. Interestingly it also makes
decoding slightly faster.

In the process I've also spotted some unused code lying around, removal is here: https://github.com/php/php-src/pull/637

Best regards
Rouven


Thread (29 messages)

« previous php.internals (#73481) next »