[antlr-interest] ANTLRWorks editor slow down

William B. Clodius wclodius at los-alamos.net
Mon Feb 1 18:37:04 PST 2010


Terr:

What I have noticed with ANTLRWorks. The first version I started with didn't seem to have the performance and stability problems. My current version 1.3.1 does have them. I think I went through two semi-automatic upgrades (Two notifications that upgrades were available which I naturally accepted.) This version checks for ANTLR syntax errors with every keystroke, which I don't recall for my first version. So I would definitely check out recent changes.

The slowdown takes a while to appear. I think I have it more often when I am working with the string template generator files than with my large toy grammar, but I have definitely seen it with both. FWIW my suspicion is a memory leak, but there are other possibilities. I believe there was talk a few months ago of using Java's unbuffered IO as the default for ANTLR itself, which can have serious performance problems, but I suspect is not the cause here. Java's poor default hash function could also be a contributor, but that suspicion could just be because I am reading Valloud's text, and he has strong opinions on that topic.

On Feb 1, 2010, at 12:40 PM, Terence Parr wrote:

> Hi,
> 
> Jean and I are re-factoring ANTLRWorks to be much simpler in anticipation of me taking over maintenance and adding features. The first thing I want to do is find out why AW sometimes slows to a crawl. I can't seem to reproduce it when I want to, although it was really really slow the other day before I decided to debug it! ;)  
> 
> So, I need your help to figure out when it occurs so that it will give me a clue about where to look in the source code.   My impression is that one of the triggers seems to be when there are lots of errors. But, when I added a whole bunch of grammar windows and then started randomly inserting errors all over the grammar, memory usage didn't really go up and it didn't slow down at all (lots other errors to the console, but that's it). I wonder though if it was getting more memory available to it in the debugger than when I run it from the jar file. Also, I note that sometimes undo is extremely slow, so that is also a potential area to look.
> 
> My current candidates for slowdown:
> 
> * running out of memory and thrashing
> * undo mechanism is tracking too much or something
> * error mechanism somehow  tracks too much or has too much work to do
> 
> Each keystroke triggers colorizing the editor window, but Jean tells me he's sure that the parser itself is okay. might be the error handling though.
> 
> Can anybody reproduce a case where you start ANTLRWorks and then do some stuff in the editor window with a grammar (of any size) and it starts to get really slow to type? Even if you can't send me your grammar, I can send you an instrumented version of AW that will turn out some information about what is going on.
> 
> Thanks! This is my highest priority for AW since I'm using it to build v4 ANTLR.
> 
> Thanks,
> Ter
> 
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address
> 



More information about the antlr-interest mailing list