Re: Performance of LPeg 1.0.2

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Performance of LPeg 1.0.2

Roberto Ierusalimschy
> I have used LPeg 1.0.1 for parsing lua and json for a long time.
>
> Recently I update the LPeg to 1.0.2, and found that the speed of parsing is much slower than it was in 1.0.1 .
>
> I did a test that create a simple json parser to parse a json file for 1000 times, in 1.0.1 it takes abort 0.59 sec and in 1.0.2 it takes abort 1.269 sec.
>
> [...]

I tried to reproduce your experiment, but in my setting I get basically
the same time for 1.0.1 and 1.0.2 (~0.27 sec).

-- Roberto

Reply | Threaded
Open this post in threaded view
|

答复: Performance of LPeg 1.0.2

最萌 小汐

> I tried to reproduce your experiment, but in my setting I get basically
> the same time for 1.0.1 and 1.0.2 (~0.27 sec).
>
> -- Roberto

 

I just tested again and found that I undefined `NDEBUG` when compiling.

After defining `NDEBUG`, I got the same time:

 

===========test lpeg-1.0.1-DEBUG====================

0.616

===========test lpeg-1.0.2-DEBUG====================

1.053

===========test lpeg-1.0.1-NDEBUG====================

0.598

===========test lpeg-1.0.2-NDEBUG====================

0.541