@ligee, I've assigned this issue to you, as we're waiting on info about the location of compiled .kts scripts. Just let us know and I'll assign it back to one of us to take the next steps.
Slating this for M3 to ensure we get the most important features implemented by the M2 deadline. Note that while script caching will improve performance, it is less important in the context of the daemon being enabled by default.
This is what we'll need to add to our compiler configuration to enable script caching
Copied from Slack:
Cédric> does it make sure it works properly cross-process? That is to say, uses the same guards/cache managers as the Groovy version?
There were quite a few bugs in the past wrt the Groovy scripts, for example 2 process using the same script file, but one is changed during the execution of the other. Using a simple directory for output doesn't work for this.
(that's why the caching strategy in FileCacheBackedScriptClassCompiler is complex (not speaking of the L1 in-memory cache)
Introduce CacheKeyBuilder service
Required to implement script caching in gradle-script-kotlin without
Hash strings using UTF8 encoding for performance
Thanks for the tip, @lptr!
Rename method to better reflect its purpose
Fix BigInteger construction
Favor Groovy literal syntax over BigInteger.valueOf
Support building cache key from ClassLoader
Cache compiled scripts
- Introduce CachingKotlinCompiler
- Add compilation ClassPath (as ClassLoader) to cache key
- Add version number to script cache
- Honor `--recompile-scripts`
- Report compilation progress
Hash string before combining to minimize chance of collision
Which could arise given two string components ["foo", "barbaz"] versus