Experimental support for keeping the Scala compiler resident with sbt.resident.limit?

StackOverflow https://stackoverflow.com/questions/23278316

  •  09-07-2023
  •  | 
  •  

Pergunta

I've just noticed in the code of sbt.BuiltinCommands that there's a Java command line setting - sbt.resident.limit that (quoting Experimental or In-progress):

Experimental support for keeping the Scala compiler resident. Enable by passing -Dsbt.resident.limit=n to sbt, where n is an integer indicating the maximum number of compilers to keep around.

Should an end user know the switch? Where could it be useful? Is the feature going into a mainstream use or is it so specialized that almost of no use?

Foi útil?

Solução

We've experimented with keeping Scala compiler instances in memory to reduce the time it takes to perform incremental compilation. Our findings showed us that the improvements to speed were not as large as we expected. The complexity of resident compilation is really large due to issues like memory leaks or sound symbol table invalidation.

I think it's very unlikely we'll finish that experimental feature in any foreseeable future so I think we should remove any references to resident compilation mode from sbt sources.

I created an sbt ticket for tracking it: https://github.com/sbt/sbt/issues/1287

Feel free to grab it. I'm happy to assist you with any questions related to cleaning up sbt code from resident compilation mode.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top