TL;DR

DynSem runs analysis on almost every keystroke. The analysis time goes up with large files or large amounts of sorts/rules (not sure yet which). So when typing there are lots of analyses scheduled which are useless. And it takes minutes before the actual analysis of the current file is done.

So can the analysis be delayed until the file changes have stopped for some amount of milliseconds?

Context

I have this DynSem file that’s at 550 lines and still growing. I’m not sure if it’s the size of this file or the size of the all the DynSem rules in the project, but analysing the file takes over 13 seconds. And this analysis is triggered multiple times while I’m copy-pasting and typing. So my Progress View in Eclipse suddenly has 12 or more of the analysis tasks stacking up. And the analysis results of all but the last are useless. I’m going to experiment with splitting into multiple files when it’s done with the current queue of analyses.

Submitted by Jeff Smits on 17 April 2015 at 02:10

On 17 April 2015 at 18:51 Jeff Smits commented:

I’ve split up my huge file into:

  • signatures.ds, which defines all internal sorts, all arrows and gets imported by all the other files.
  • a main .ds file which imports all the others
  • Some .ds files that only import signatures.ds

This allows me to not have cyclic imports. It’s a better structure than the one huge file. But the analysis time has not gone down.


On 17 April 2015 at 22:57 Jeff Smits commented:

Argh, I found the thing making DynSem slow, and I was warned about that problem already. I had a bunch of sorts defined as injections with Ref -> Expr. That was making everything so slow. I added explicit constructors, so that should fix the problem for now.


On 17 April 2015 at 23:39 Jeff Smits commented:

Hmm, those sort injections were only part of the problem I guess. It still takes some time to run these analyses and they still stack up in the progress view, making Eclipse less responsive.


On 20 April 2015 at 12:16 Vlad Vergu commented:

Thanks for the suggestion Jeff. Regarding the injections, we’re phasing them out anyway. Regarding cancelation of a queued analysis we’re dependent on Spoofax for that. It is the one responsible for queuing and canceling analysis jobs.

Log in to post comments