1 Replies Last post: Feb 15, 2012 12:45 PM by Alexander Podkhalyuzin  
HamsterofDeath  Apprentice 653 posts since
Jan 19, 2004
Currently Being Moderated

Feb 11, 2012 10:27 PM

performance question

hi there,

 

could it be that code completion is faster if i add type annotations to my code? if yes, couldn't the type of each symbol be cached? it has to be evaluated anyway when parsing the file, and as long as i don't change the file, the type cannot change. and if i type anything, it will be reparsed anyway.

Alexander Podkhalyuzin JetBrains 687 posts since
Jun 7, 2008
Currently Being Moderated
Feb 15, 2012 12:45 PM in response to: HamsterofDeath
Re: performance question

Unfortunately type can be changed by any change:

class A {
  def foo = goo
 
  def goo = 1 //change it to "" and type of 'foo' will be changed
} 

 

I'm sure it's possible to handle dependencies and to do smarter caching, but I'm also sure that it's too complex to do it now.

 

Current plugin state of this problem is that everything will be much faster if you type code inside '{}', which cannot change anything outside this scope, for example:

class A {
  def foo: Int = {
    //everything will be faster during typing just here
  } 
}

 

Best regards,

Alexander Podkhalyuzin.

More Like This

  • Retrieving data ...