mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[kotlin] Fix path to aggregated results of performance tests
GitOrigin-RevId: 8990ec57b7eb4267e825aca7c1e1605e6e3aebe0
This commit is contained in:
committed by
intellij-monorepo-bot
parent
1c5879db84
commit
cac8c334aa
+1
-3
@@ -3,14 +3,12 @@ package org.jetbrains.kotlin.idea.perf.live
|
||||
|
||||
import junit.framework.TestCase
|
||||
import org.jetbrains.kotlin.idea.perf.util.uploadAggregateResults
|
||||
import org.jetbrains.kotlin.test.KotlinRoot
|
||||
import java.io.File
|
||||
|
||||
/**
|
||||
* It has to be the last package test, see `com.intellij.TestCaseLoader#getClasses`
|
||||
*/
|
||||
class ZeLastPackageTest: TestCase() {
|
||||
fun test() {
|
||||
uploadAggregateResults(File(KotlinRoot.REPO, "out"))
|
||||
uploadAggregateResults()
|
||||
}
|
||||
}
|
||||
+1
-3
@@ -3,14 +3,12 @@ package org.jetbrains.kotlin.idea.perf.synthetic
|
||||
|
||||
import junit.framework.TestCase
|
||||
import org.jetbrains.kotlin.idea.perf.util.uploadAggregateResults
|
||||
import org.jetbrains.kotlin.test.KotlinRoot
|
||||
import java.io.File
|
||||
|
||||
/**
|
||||
* It has to be the last package test, see `com.intellij.TestCaseLoader#getClasses`
|
||||
*/
|
||||
class ZeLastPackageTest: TestCase() {
|
||||
fun test() {
|
||||
uploadAggregateResults(File(KotlinRoot.REPO, "out"))
|
||||
uploadAggregateResults()
|
||||
}
|
||||
}
|
||||
+11
-3
@@ -2,14 +2,22 @@
|
||||
|
||||
package org.jetbrains.kotlin.idea.perf.util
|
||||
|
||||
import org.jetbrains.kotlin.test.KotlinRoot
|
||||
import java.io.File
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
uploadAggregateResults(File(args[0]))
|
||||
}
|
||||
|
||||
internal fun uploadAggregateResults(folder: File) {
|
||||
val groupBy = folder.listFiles()
|
||||
internal fun uploadAggregateResults() {
|
||||
val parent = System.getProperty("idea.home.path")?.let(::File) ?: KotlinRoot.REPO
|
||||
uploadAggregateResults(File(parent, "out"))
|
||||
}
|
||||
|
||||
private fun uploadAggregateResults(folder: File) {
|
||||
val listFiles = folder.listFiles() ?: emptyArray()
|
||||
logMessage { "uploadAggregateResults from $folder ${listFiles.joinToString { it.absolutePath }}" }
|
||||
val groupBy = listFiles
|
||||
.filter { it.length() > 0 && it.name.startsWith("stats-") && it.extension == "json" }
|
||||
.groupBy { it.name.replace("stats-", "").split("_")[0] }
|
||||
|
||||
@@ -17,7 +25,7 @@ internal fun uploadAggregateResults(folder: File) {
|
||||
files.map(File::loadBenchmark).writeCSV(n)
|
||||
}
|
||||
|
||||
groupBy.forEach { (k, v) ->
|
||||
groupBy.forEach { (_, v) ->
|
||||
if (v.isEmpty()) return@forEach
|
||||
|
||||
val benchmarks = v.map(File::loadBenchmark)
|
||||
|
||||
+57
-64
@@ -50,89 +50,82 @@ class HighlightWholeProjectPerformanceTest : UsefulTestCase() {
|
||||
|
||||
val projectSpecs = projectSpecs()
|
||||
logMessage { "projectSpecs: $projectSpecs" }
|
||||
try {
|
||||
for (projectSpec in projectSpecs) {
|
||||
val projectName = projectSpec.name
|
||||
val projectPath = projectSpec.path
|
||||
for (projectSpec in projectSpecs) {
|
||||
val projectName = projectSpec.name
|
||||
val projectPath = projectSpec.path
|
||||
|
||||
val suiteName =
|
||||
listOfNotNull("allKtFilesIn", "emptyProfile".takeIf { emptyProfile }, projectName)
|
||||
.joinToString(separator = "-")
|
||||
suite(suiteName = suiteName) {
|
||||
app {
|
||||
ExpressionsOfTypeProcessor.prodMode()
|
||||
warmUpProject()
|
||||
val suiteName =
|
||||
listOfNotNull("allKtFilesIn", "emptyProfile".takeIf { emptyProfile }, projectName)
|
||||
.joinToString(separator = "-")
|
||||
suite(suiteName = suiteName) {
|
||||
app {
|
||||
ExpressionsOfTypeProcessor.prodMode()
|
||||
warmUpProject()
|
||||
|
||||
with(config) {
|
||||
warmup = warmUpIterations
|
||||
iterations = numberOfIterations
|
||||
fastIterations = true
|
||||
}
|
||||
with(config) {
|
||||
warmup = warmUpIterations
|
||||
iterations = numberOfIterations
|
||||
fastIterations = true
|
||||
}
|
||||
|
||||
try {
|
||||
project(ExternalProject.autoOpenProject(projectPath), refresh = true) {
|
||||
profile(if (emptyProfile) EmptyProfile else DefaultProfile)
|
||||
try {
|
||||
project(ExternalProject.autoOpenProject(projectPath), refresh = true) {
|
||||
profile(if (emptyProfile) EmptyProfile else DefaultProfile)
|
||||
|
||||
val ktFiles = mutableSetOf<VirtualFile>()
|
||||
project.runReadActionInSmartMode {
|
||||
val projectFileIndex = ProjectFileIndex.getInstance(project)
|
||||
val modules = mutableSetOf<Module>()
|
||||
val ktFileProcessor = { ktFile: VirtualFile ->
|
||||
if (projectFileIndex.isInSourceContent(ktFile)) {
|
||||
ktFiles.add(ktFile)
|
||||
}
|
||||
true
|
||||
val ktFiles = mutableSetOf<VirtualFile>()
|
||||
project.runReadActionInSmartMode {
|
||||
val projectFileIndex = ProjectFileIndex.getInstance(project)
|
||||
val modules = mutableSetOf<Module>()
|
||||
val ktFileProcessor = { ktFile: VirtualFile ->
|
||||
if (projectFileIndex.isInSourceContent(ktFile)) {
|
||||
ktFiles.add(ktFile)
|
||||
}
|
||||
FileTypeIndex.processFiles(
|
||||
KotlinFileType.INSTANCE,
|
||||
ktFileProcessor,
|
||||
GlobalSearchScope.projectScope(project)
|
||||
)
|
||||
modules
|
||||
true
|
||||
}
|
||||
FileTypeIndex.processFiles(
|
||||
KotlinFileType.INSTANCE,
|
||||
ktFileProcessor,
|
||||
GlobalSearchScope.projectScope(project)
|
||||
)
|
||||
modules
|
||||
}
|
||||
|
||||
logStatValue("number of kt files", ktFiles.size)
|
||||
val filesToProcess =
|
||||
limitedFiles(
|
||||
ktFiles,
|
||||
percentOfFiles = percentOfFiles,
|
||||
maxFilesPerPart = maxFilesPerPart,
|
||||
minFileSize = minFileSize
|
||||
)
|
||||
logStatValue("limited number of kt files", filesToProcess.size)
|
||||
logStatValue("number of kt files", ktFiles.size)
|
||||
val filesToProcess =
|
||||
limitedFiles(
|
||||
ktFiles,
|
||||
percentOfFiles = percentOfFiles,
|
||||
maxFilesPerPart = maxFilesPerPart,
|
||||
minFileSize = minFileSize
|
||||
)
|
||||
logStatValue("limited number of kt files", filesToProcess.size)
|
||||
|
||||
filesToProcess.forEach {
|
||||
logMessage { "${project.relativePath(it)} fileSize: ${Files.size(it.toNioPath())}" }
|
||||
}
|
||||
filesToProcess.forEach {
|
||||
logMessage { "${project.relativePath(it)} fileSize: ${Files.size(it.toNioPath())}" }
|
||||
}
|
||||
|
||||
filesToProcess.forEachIndexed { idx, file ->
|
||||
logMessage { "${idx + 1} / ${filesToProcess.size} : ${project.relativePath(file)} fileSize: ${Files.size(file.toNioPath())}" }
|
||||
filesToProcess.forEachIndexed { idx, file ->
|
||||
logMessage { "${idx + 1} / ${filesToProcess.size} : ${project.relativePath(file)} fileSize: ${Files.size(file.toNioPath())}" }
|
||||
|
||||
try {
|
||||
fixture(file).use {
|
||||
measure<List<HighlightInfo>>(it.fileName, clearCaches = clearPsiCaches) {
|
||||
test = {
|
||||
highlight(it)
|
||||
}
|
||||
try {
|
||||
fixture(file).use {
|
||||
measure<List<HighlightInfo>>(it.fileName, clearCaches = clearPsiCaches) {
|
||||
test = {
|
||||
highlight(it)
|
||||
}
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
// nothing as it is already caught by perfTest
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
// nothing as it is already caught by perfTest
|
||||
}
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
// nothing as it is already caught by perfTest
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
// nothing as it is already caught by perfTest
|
||||
}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
pathToResource("").takeIf { it.exists() }?.let {
|
||||
logMessage { "uploadAggregateResults: ${it.absolutePath}" }
|
||||
uploadAggregateResults(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-3
@@ -3,14 +3,12 @@ package org.jetbrains.kotlin.idea.perf.whole
|
||||
|
||||
import junit.framework.TestCase
|
||||
import org.jetbrains.kotlin.idea.perf.util.uploadAggregateResults
|
||||
import org.jetbrains.kotlin.test.KotlinRoot
|
||||
import java.io.File
|
||||
|
||||
/**
|
||||
* It has to be the last package test, see `com.intellij.TestCaseLoader#getClasses`
|
||||
*/
|
||||
class ZeLastPackageTest: TestCase() {
|
||||
fun test() {
|
||||
uploadAggregateResults(File(KotlinRoot.REPO, "out"))
|
||||
uploadAggregateResults()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user