Fork me on GitHub
#instaparse
<
2016-01-12
>
meow08:01:52

what is performance like for instaparse - someone I'm working with had a problem in the past with it being slow but never tracked down the source of the problem

ska10:01:28

When parsing becomes slow, it might be due to the grammar being ambiguous. In general, I'd say that Instparse is good enough for many use cases, even if I've read papers complaining about the perf. The one that I still have was written in German, though.

meow10:01:53

I'll tell the #C0J20813K devs to come here to find out how to parse fast

meow10:01:01

@ska: thanks for the info! simple_smile

jamesnvc15:01:52

Yeah, I really like using instaparse server-side, but I tried writing one in cljs (pretty simple, just extracting links) and it was noticeably slow...

jamesnvc15:01:06

it was being called on a lot of text, but is there something I should be doing?

ska15:01:09

@jamesnvc: sometimes it is possible to chunk the text before parsing it. For example, when parsing logfiles use instaparse just for the lines not the whole file.

jamesnvc15:01:45

This is a bunch of little chunks of text; being called on the text of each message in a chat client

jamesnvc15:01:16

I’ll try writing the grammar again and make sure it isn’t ambiguous

ghadi16:01:12

I have a new parser that should be much faster than instaparse if you have no ambiguity

ghadi16:01:56

needs better docs 😃

jamesnvc16:01:51

oh cool, I’ll give that a shot, thanks!

jamesnvc16:01:32

@ghadi oh, does this work in clojurescript though? That is my issue with instaparse — my clj perf is fine, but cljs leaves something to be desired

ghadi16:01:55

oh, no it doesn't

ghadi16:01:15

should perform well there too, want to port a virtual machine ? 😉

jamesnvc16:01:08

Oh, interesting...

jamesnvc16:01:35

I may consider that, if just as a fun project!

ghadi17:01:17

Peg.js is pretty nice, IMHO