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
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.
I'll tell the #C0J20813K devs to come here to find out how to parse fast
@rafd: ^
@ska: thanks for the info! :simple_smile:
hello
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...
it was being called on a lot of text, but is there something I should be doing?
@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.
This is a bunch of little chunks of text; being called on the text of each message in a chat client
I’ll try writing the grammar again and make sure it isn’t ambiguous
I have a new parser that should be much faster than instaparse if you have no ambiguity
needs better docs 😃
https://groups.google.com/d/msg/clojure/2ph-6o_Zydc/0O2DRDXBAwAJ
oh cool, I’ll give that a shot, thanks!
@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
oh, no it doesn't
should perform well there too, want to port a virtual machine ? 😉
https://github.com/ghadishayban/pex/blob/master/src-java/com/champbacon/pex/impl/PEGByteCodeVM.java
Oh, interesting...
I may consider that, if just as a fun project!
Peg.js is pretty nice, IMHO