Dmitry Solomennikov

Results 14 comments of Dmitry Solomennikov

We investigated issue a bit and figured out that underlying data structures are significantly slow. For example, this line https://github.com/antlr/antlr4/blob/e73f72be7355aded374fa6b18fccb4569b449856/runtime/Go/antlr/parser_atn_simulator.go#L1040 works 14 seconds out of 49 seconds for whole parsing....

Simple fixups made parsing about twice faster: https://github.com/antlr/antlr4/pull/2915

Added one more commit to #2915, eliminated excessive calculations, 3 times faster.

For technical reasons removed previous PR and created new one with the same content: #2916

Added another improvement. BitSet without pointers reduced parsing time about twice more. @jlj5aj Please try again. If it helps than next step possibly is to rewrite Set for simpler underlying...

Thanks for feedback. Looks like because I'm testing with different grammar we get different memory usages.

Well, I spent a lot of time for investigations. During parsing runtime sometimes call `AdaptivePredict()` routine, which in turn, works with `ATNConfig` structure. It produces a lot of (literally millions)...

For our current project we rewrote parser and made it handwritten. I still want to rewrite Go backend of Antlr, but now it is out of scope of my project.

Occasionally I got a chance to dive into a problem once again. I tried several more approaches to deal with the performance of Go runtime. Among these are: * deferred...

There is an example in [Adaptive LL(*) Parsing: The Power of Dynamic Analysis](https://www.antlr.org/papers/allstar-techreport.pdf) report (section 3.1) about that, but I was not able to reproduce it.