Fork me on GitHub
#instaparse
<
2017-12-13
>
Empperi09:12:06

hmm, I have a rather large EBNF that I’m using to initialize an instaparse parser in ClojureScript

Empperi09:12:38

It works just fine but the problem is that the parser creation takes a long time and since it’s ClojureScript that causes the UI to freeze while it is being created

Empperi09:12:01

I was wondering if there is any way to do this in a webworker and if anyone has tried to do that before

Empperi09:12:25

my initial feeling is that “no you cannot use webworkers” since they work with message passing and as such only Strings can be passed

hlolli10:12:28

@niklas.collin are you using the defparser macro?

Empperi10:12:53

no, I’m using instaparse.core/parser

hlolli10:12:24

I wonder if you'd be faster if you'd be using the macro, then it precompiles a bit.

Empperi10:12:34

dunno, maybe

Empperi10:12:41

I could try

Empperi10:12:52

well, that’s what the defparser documentation in instaparse github page says that it should work better

Empperi10:12:57

thanks, will try that

Empperi10:12:21

yeah, now performance is pretty much instant

Empperi10:12:24

cheers 🙂

aengelberg17:12:35

@hlolli yep, that's exactly what it's meant for. @niklas.collin I'm glad it served its purpose!