Re: [Factor-talk] Peg Parser Performance

2020-11-23 Thread Alexander Ilin
Good idea, thanks! 23.11.2020, 23:32, "John Benediktsson" :We can continue this discussion if you'd like on GitHub: https://github.com/factor/factor/issues/2377 ---=---Александр  ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://

Re: [Factor-talk] Peg Parser Performance

2020-11-23 Thread John Benediktsson
We can continue this discussion if you'd like on GitHub: https://github.com/factor/factor/issues/2377 On Sun, Nov 22, 2020 at 9:34 PM Alexander Ilin wrote: > If I remove all => actions, the time goes down to 120 seconds. > > > 23.11.2020, 00:18, "John Benediktsson" : > > I suspect it’s a lot

Re: [Factor-talk] Peg Parser Performance

2020-11-22 Thread Alexander Ilin
If I remove all => actions, the time goes down to 120 seconds.  23.11.2020, 00:18, "John Benediktsson" :I suspect it’s a lot of “swap prefix >string” type stuff that’s different, but I can help you profile this a little later today or tomorrow.   On Nov 22, 2020, at 1:07 PM, Alexander Ilin

Re: [Factor-talk] Peg Parser Performance

2020-11-22 Thread John Benediktsson
I suspect it’s a lot of “swap prefix >string” type stuff that’s different, but I can help you profile this a little later today or tomorrow. > On Nov 22, 2020, at 1:07 PM, Alexander Ilin wrote: > >  > Hello! > > I put the code into a vocab, restarted the Listener and repeated the test >

Re: [Factor-talk] Peg Parser Performance

2020-11-22 Thread Alexander Ilin
Hello!  I put the code into a vocab, restarted the Listener and repeated the test like so: IN: log-db EBNF: parse-csv-line [=[   quotedColumn = "\""~ (!("\"") .)* "\""~ quotedColumn*       => [[ first2 swap prefix [ >string ] map "\"" join ]]   unquotedColumn = (!("\t") .)*   column = ( quotedColum

Re: [Factor-talk] Peg Parser Performance

2020-11-22 Thread John Benediktsson
When you run that in the listener it uses the non optimizing compiler. You should use the EBNF: word [=[ ... ]=] form and then refer to word for it to be a compiled parser. It’ll be much faster. Or wrap all that in a : foo ( — ) ... ; > On Nov 22, 2020, at 11:49 AM, Alexander Ilin wrote:

[Factor-talk] Peg Parser Performance

2020-11-22 Thread Alexander Ilin
Hello! I've got my first test results, and I'm having some doubts. The following code runs almost 200 seconds on a 20Mb file: "file-name.csv" [ utf8 [ input-stream get [ EBNF[=[ quotedColumn = "\""~ (!("\"") .)* "\""~ quotedColumn* => [[ first2 swap prefix [