Quantcast

Parboiled2 vs ...

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Parboiled2 vs ...

newca12
This post was updated on .
Using quick and dirty Json benchmark from Lift :
https://github.com/lift/framework/tree/master/core/json/benchmark

Give the following results :

Jackson 195ms
Lift Json 336ms
Parboiled2 338ms
Parboiled 4329ms
Scala std 73347ms

Of course this is too early because JsonSimpleParser in Parboiled2 is very primitive but so far so good.
https://gist.github.com/newca12/6565708

Regards,
Olivier ROLAND
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Parboiled2 vs ...

mathias
Administrator
Olivier,

interesting, thanks for these numbers!
So far the JsonSimpleParser example from parboiled2 is nothing more than a toy example for testing our new parsing infrastructure.
Neither the parsing infrastructure nor the JSON parser have yet been optimized.
Insofar it's great to see that the basic approach is indeed delivering the performance we've been targeting.

Cheers,
Mathias

---
[hidden email]
http://www.parboiled.org

On 14.09.2013, at 19:44, newca12 [via parboiled users] <[hidden email]> wrote:

>
>
> Using quick and dirty Json benchmark from Lift :
> https://github.com/lift/framework/tree/master/core/json/benchmark
>
> Give the following results :
>
> Jackson 195ms
> Lift Json 336ms
> Parboiled2 338ms
> Parboiled 76546ms
> Scala std 83636ms
>
> Of course this is too early because JsonSimpleParser in Parboiled2 is very
> primitive but so far so good.
> Code is here : https://gist.github.com/anonymous/6563971
>
> Regards,
> Olivier ROLAND
>
>
>
> _______________________________________________
> If you reply to this email, your message will be added to the discussion below:
> http://users.parboiled.org/Parboiled2-vs-tp4024244.html
> To start a new topic under parboiled users, email [hidden email]
> To unsubscribe from parboiled users, visit class="small">
signature.asc (858 bytes)
Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Parboiled2 vs ...

NicholasSterling
In reply to this post by newca12
The recent announcement for parboiled 2.0-M2 at

https://groups.google.com/forum/#!msg/parboiled-user/bIQuz21aGwg/coHmtqTphdUJ

mentioned that M2 improves performance over M1 by about 30%.  That puts it in Jackson territory, presumably -- very impressive!

Nicholas
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Parboiled2 vs ...

mathias
Administrator
Nicholas,

even though pb2-M2 is quite a bit faster than pb2-M1 it is extremely hard to have its JSON parser example perform similarly to Jackson.
Jackson is very carefully handcrafted for max performance and is generally about twice as fast as other hand-written parsers.
I don’t believe that *any* parser generator will be able to produce code that is as efficient as Jackson’s.

However, pb2 is not a JSON parser, it’s a tool for easily building parsers.
As such it has to perform well in order to be applicable to a wide range to use cases.
We believe that even in its current state it easily meets that requirement.

Here is how pb2’s JSON parser example performs on my MBP:

[info]            benchmark      ms linear runtime
[info] Parboiled1JsonParser   73.81 =
[info] Parboiled2JsonParser   10.49 =
[info]         Json4SNative    7.35 =
[info]        Json4SJackson    3.38 =
[info]             Argonaut    6.08 =
[info]    ParserCombinators 2385.78 ==============================

If I disable the Scala Parser Combinators example (because it completely ruins the scale) the result looks like this:

[info]            benchmark    ms linear runtime
[info] Parboiled1JsonParser 74.64 ==============================
[info]         Json4SNative  7.30 ==
[info]        Json4SJackson  3.29 =
[info]             Argonaut  6.03 ==
[info] Parboiled2JsonParser 10.45 ====

So Jackson is still about 3 times as fast as the pb2-based JSON parser.
However, we are certainly not done optimising pb2 yet, so we should be able to get a little closer (without requiring you to change your pb2-based code).

Cheers,
Mathias

---
[hidden email]
http://www.parboiled.org

On 13 Feb 2014, at 00:19, NicholasSterling [via parboiled users] <[hidden email]> wrote:

> The recent announcement for parboiled 2.0-M2 at
>
> https://groups.google.com/forum/#!msg/parboiled-user/bIQuz21aGwg/coHmtqTphdUJ
>
> mentioned that M2 improves performance over M1 by about 30%.  That puts it in Jackson territory, presumably -- very impressive!
>
> Nicholas
>
>
> If you reply to this email, your message will be added to the discussion below:
> http://users.parboiled.org/Parboiled2-vs-tp4024244p4024273.html
> To start a new topic under parboiled users, email [hidden email]
> To unsubscribe from parboiled users, click here.
> NAML

Loading...