[JS IR IC] Implement fast path invalidation check

Compute library md5 hash and check it first with cached one. If hashes
are equal it means that cache is up-to-date and no additional checks are
needed

 - store library hashes (flat + trans) into cache info file
 - change invalidator return value
This commit is contained in:
Roman Artemev
2021-12-13 17:18:09 +03:00
committed by teamcity
parent 5ba6ca4c16
commit b719865c25
6 changed files with 132 additions and 48 deletions
@@ -208,7 +208,7 @@ class K2JsIrCompiler : CLICompiler<K2JSCompilerArguments>() {
val start = System.currentTimeMillis()
val updated = actualizeCacheForModule(
val updateStatus = actualizeCacheForModule(
includes,
outputFilePath,
configurationJs,
@@ -218,13 +218,10 @@ class K2JsIrCompiler : CLICompiler<K2JSCompilerArguments>() {
::buildCacheForModuleFiles
)
if (updated) {
messageCollector.report(INFO, "IC per-file cache building duration: ${System.currentTimeMillis() - start}ms")
if (updateStatus.upToDate) {
messageCollector.report(INFO, "IC per-file cache up-to-date check duration: ${System.currentTimeMillis() - start}ms")
} else {
messageCollector.report(
INFO,
"IC per-file cache up-to-date check duration: ${System.currentTimeMillis() - start}ms"
)
messageCollector.report(INFO, "IC per-file cache building duration: ${System.currentTimeMillis() - start}ms")
}
return OK
}