[New IC] Optimize Java class snapshotting with ASM ClassWriter
To snapshot a Java class (+ its fields and methods), previously we used
Gson to serialize a class field/method to a string via reflection, and
hash that string.
We now use an ASM ClassWriter to write a placeholder class containing
the field/method of interest and hash the bytecode of that class.
One experiment showed that this new approach is ~10 times faster than
the previous approach (140s down to 16s when snapshotting 600 jars).
Test: Updated expectation files for JavaClassSnapshotterTest unit tests
+ Existing integration tests to prevent regression
^KT-52141 In Progress
This commit is contained in:
@@ -18,7 +18,6 @@ dependencies {
|
||||
api(project(":compiler:backend.jvm.entrypoint"))
|
||||
api(project(":kotlin-build-common"))
|
||||
api(project(":daemon-common"))
|
||||
implementation(commonDependency("com.google.code.gson:gson"))
|
||||
compileOnly(intellijCore())
|
||||
|
||||
testApi(commonDependency("junit:junit"))
|
||||
@@ -30,6 +29,7 @@ dependencies {
|
||||
testApi(commonDependency("org.jetbrains.intellij.deps:log4j"))
|
||||
testApi(commonDependency("org.jetbrains.intellij.deps:jdom"))
|
||||
|
||||
testImplementation(commonDependency("com.google.code.gson:gson"))
|
||||
testRuntimeOnly(project(":kotlin-reflect"))
|
||||
testRuntimeOnly(project(":core:descriptors.runtime"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user