Separate performance project (#4473)
This commit is contained in:
committed by
Stanislav Erokhin
parent
590aa42f3d
commit
e57839ece6
@@ -1,5 +1,5 @@
|
||||
buildscript {
|
||||
apply from: "$rootProject.projectDir/gradle/kotlinGradlePlugin.gradle"
|
||||
apply from: "$rootProject.projectDir/../gradle/kotlinGradlePlugin.gradle"
|
||||
repositories {
|
||||
maven {
|
||||
url 'https://cache-redirector.jetbrains.com/jcenter'
|
||||
|
||||
@@ -18,5 +18,4 @@ swiftBenchmark {
|
||||
swiftSources = File("$projectDir/src").list().map { "$projectDir/src/$it" }.toList()
|
||||
compileTasks = listOf("buildSwift")
|
||||
useCodeSize = CodeSizeEntity.EXECUTABLE
|
||||
dependencies.common(project(":endorsedLibraries:kotlinx.cli"))
|
||||
}
|
||||
@@ -4,12 +4,23 @@ import org.jetbrains.kotlin.BuildRegister
|
||||
import org.jetbrains.kotlin.MPPTools
|
||||
|
||||
buildscript {
|
||||
apply from: "$rootProject.projectDir/gradle/kotlinGradlePlugin.gradle"
|
||||
ext.rootBuildDirectory = file('..')
|
||||
|
||||
apply from: "$rootBuildDirectory/gradle/loadRootProperties.gradle"
|
||||
apply from: "$rootBuildDirectory/gradle/kotlinGradlePlugin.gradle"
|
||||
repositories {
|
||||
maven {
|
||||
url 'https://cache-redirector.jetbrains.com/jcenter'
|
||||
}
|
||||
maven { url 'https://cache-redirector.jetbrains.com/jcenter'}
|
||||
maven { url 'https://cache-redirector.jetbrains.com/maven-central' }
|
||||
mavenCentral()
|
||||
maven { url buildKotlinCompilerRepo }
|
||||
maven { url kotlinCompilerRepo }
|
||||
jcenter()
|
||||
maven { url "https://kotlin.bintray.com/kotlinx" }
|
||||
maven { url "https://dl.bintray.com/kotlin/kotlin-dev" }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath "org.jetbrains.kotlin:kotlin-native-build-tools:$konanVersion"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@ benchmark {
|
||||
mingwSrcDirs = listOf("src/main/kotlin-native", "../shared/src/main/kotlin-native/mingw")
|
||||
posixSrcDirs = listOf("src/main/kotlin-native", "../shared/src/main/kotlin-native/posix")
|
||||
buildType = (findProperty("nativeBuildType") as String?)?.let { NativeBuildType.valueOf(it) } ?: defaultBuildType
|
||||
dependencies.common(project(":endorsedLibraries:kotlinx.cli"))
|
||||
}
|
||||
|
||||
val native = kotlin.targets.getByName("native") as KotlinNativeTarget
|
||||
|
||||
@@ -4,7 +4,7 @@ import org.jetbrains.kotlin.RunJvmTask
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.NativeBuildType
|
||||
|
||||
buildscript {
|
||||
apply from: "$rootProject.projectDir/gradle/kotlinGradlePlugin.gradle"
|
||||
apply from: "$rootProject.projectDir/../gradle/kotlinGradlePlugin.gradle"
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
@@ -42,8 +42,8 @@ kotlin {
|
||||
}
|
||||
kotlin.srcDir "$toolsPath/benchmarks/shared/src"
|
||||
kotlin.srcDir "$toolsPath/benchmarksAnalyzer/src/main/kotlin"
|
||||
kotlin.srcDir "$rootProject.projectDir/endorsedLibraries/kotlinx.cli/src/main/kotlin"
|
||||
kotlin.srcDir "$rootProject.projectDir/endorsedLibraries/kotlinx.cli/src/main/kotlin-native"
|
||||
kotlin.srcDir "$rootProject.projectDir/../endorsedLibraries/kotlinx.cli/src/main/kotlin"
|
||||
kotlin.srcDir "$rootProject.projectDir/../endorsedLibraries/kotlinx.cli/src/main/kotlin-native"
|
||||
kotlin.srcDir "$toolsPath/benchmarksAnalyzer/src/main/kotlin-native"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import org.jetbrains.kotlin.benchmark.BenchmarkingPlugin
|
||||
import org.jetbrains.kotlin.ExecClang
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.NativeBuildType
|
||||
import org.jetbrains.kotlin.konan.target.HostManager
|
||||
import org.jetbrains.kotlin.konan.target.*
|
||||
|
||||
plugins {
|
||||
id("benchmarking")
|
||||
@@ -22,24 +22,7 @@ benchmark {
|
||||
nativeSrcDirs = listOf("src/main/kotlin-native", "../shared/src/main/kotlin-native/common")
|
||||
mingwSrcDirs = listOf("../shared/src/main/kotlin-native/mingw")
|
||||
posixSrcDirs = listOf("../shared/src/main/kotlin-native/posix")
|
||||
linkerOpts = listOf("$buildDir/pi.o")
|
||||
buildType = (findProperty("nativeBuildType") as String?)?.let { NativeBuildType.valueOf(it) } ?: defaultBuildType
|
||||
|
||||
dependencies.common(project(":endorsedLibraries:kotlinx.cli"))
|
||||
}
|
||||
|
||||
val compileLibary by tasks.creating {
|
||||
doFirst {
|
||||
mkdir(buildDir)
|
||||
|
||||
project.withConvention(ExecClang::class) {
|
||||
execKonanClang(HostManager.host) {
|
||||
args("-O3")
|
||||
args("-c", "$projectDir/src/nativeInterop/cinterop/pi.c")
|
||||
args("-o", "$buildDir/pi.o")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val native = kotlin.targets.getByName("native") as KotlinNativeTarget
|
||||
@@ -47,7 +30,8 @@ native.apply {
|
||||
compilations["main"].cinterops {
|
||||
create("cinterop") {
|
||||
headers("$projectDir/src/nativeInterop/cinterop/pi.h")
|
||||
extraOpts("-Xcompile-source", "$projectDir/src/nativeInterop/cinterop/pi.c")
|
||||
extraOpts("-Xsource-compiler-option", "-O3")
|
||||
}
|
||||
}
|
||||
binaries.getExecutable(BenchmarkingPlugin.NATIVE_EXECUTABLE_NAME, "RELEASE").linkTask.dependsOn(compileLibary)
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
|
||||
#include <math.h>
|
||||
#include "pi.h"
|
||||
|
||||
/* uncomment the following line to use 'long long' integers */
|
||||
#define HAS_LONG_LONG
|
||||
|
||||
@@ -11,6 +11,12 @@
|
||||
#ifndef _BELLARD_PI_H
|
||||
#define _BELLARD_PI_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
int pi_nth_digit(int n);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /*_BELLARD_PI_H*/
|
||||
|
||||
@@ -22,32 +22,17 @@ benchmark {
|
||||
nativeSrcDirs = listOf("src/main/kotlin-native", "../shared/src/main/kotlin-native/common")
|
||||
mingwSrcDirs = listOf("src/main/kotlin-native", "../shared/src/main/kotlin-native/mingw")
|
||||
posixSrcDirs = listOf("src/main/kotlin-native", "../shared/src/main/kotlin-native/posix")
|
||||
linkerOpts = listOf("-L$buildDir", "-lcomplexnumbers")
|
||||
buildType = (findProperty("nativeBuildType") as String?)?.let { NativeBuildType.valueOf(it) } ?: defaultBuildType
|
||||
|
||||
dependencies.common(project(":endorsedLibraries:kotlinx.cli"))
|
||||
}
|
||||
|
||||
val compileLibary by tasks.creating {
|
||||
doFirst {
|
||||
mkdir(buildDir)
|
||||
|
||||
project.withConvention(ExecClang::class) {
|
||||
execKonanClang(HostManager.host) {
|
||||
args("$projectDir/src/nativeInterop/cinterop/complexNumbers.m")
|
||||
args("-lobjc", "-fobjc-arc")
|
||||
args("-fPIC", "-shared", "-o", "$buildDir/libcomplexnumbers.dylib")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val native = kotlin.targets.getByName("native") as KotlinNativeTarget
|
||||
native.apply {
|
||||
compilations["main"].cinterops {
|
||||
create("classes") {
|
||||
headers("$projectDir/src/nativeInterop/cinterop/complexNumbers.h")
|
||||
extraOpts("-Xcompile-source", "$projectDir/src/nativeInterop/cinterop/complexNumbers.m")
|
||||
extraOpts("-Xsource-compiler-option", "-lobjc", "-Xsource-compiler-option", "-fobjc-arc")
|
||||
}
|
||||
}
|
||||
binaries.getExecutable(BenchmarkingPlugin.NATIVE_EXECUTABLE_NAME, "RELEASE").linkTask.dependsOn(compileLibary)
|
||||
}
|
||||
@@ -19,6 +19,4 @@ benchmark {
|
||||
mingwSrcDirs = listOf("src/main/kotlin-native", "../shared/src/main/kotlin-native/mingw")
|
||||
posixSrcDirs = listOf("src/main/kotlin-native", "../shared/src/main/kotlin-native/posix")
|
||||
buildType = (findProperty("nativeBuildType") as String?)?.let { NativeBuildType.valueOf(it) } ?: defaultBuildType
|
||||
|
||||
dependencies.common(project(":endorsedLibraries:kotlinx.cli"))
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright 2010-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* that can be found in the LICENSE file.
|
||||
*/
|
||||
|
||||
include ':ring'
|
||||
include ':cinterop'
|
||||
include ':helloworld'
|
||||
include ':numerical'
|
||||
include ':videoplayer'
|
||||
include ':framework'
|
||||
include ':startup'
|
||||
if (System.getProperty("os.name") == "Mac OS X") {
|
||||
include ':objcinterop'
|
||||
include ':swiftinterop'
|
||||
if (hasProperty("runExcludedBenchmarks")) {
|
||||
include ':KotlinVsSwift'
|
||||
include ':KotlinVsSwift:ring'
|
||||
}
|
||||
}
|
||||
|
||||
includeBuild '../build-tools'
|
||||
|
||||
@@ -22,6 +22,4 @@ benchmark {
|
||||
posixSrcDirs = listOf("../shared/src/main/kotlin-native/posix")
|
||||
buildType = (findProperty("nativeBuildType") as String?)?.let { NativeBuildType.valueOf(it) } ?: defaultBuildType
|
||||
repeatingType = BenchmarkRepeatingType.EXTERNAL
|
||||
|
||||
dependencies.common(project(":endorsedLibraries:kotlinx.cli"))
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.NativeBuildType
|
||||
|
||||
import org.jetbrains.kotlin.konan.target.*
|
||||
/*
|
||||
* Copyright 2010-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* that can be found in the LICENSE file.
|
||||
@@ -12,7 +12,7 @@ plugins {
|
||||
val toolsPath = "../../tools"
|
||||
val targetExtension = "Macos"
|
||||
val defaultBuildType = NativeBuildType.RELEASE
|
||||
|
||||
project.extra["platformManager"] = PlatformManager(projectDir.parentFile.parentFile.absolutePath, false)
|
||||
swiftBenchmark {
|
||||
applicationName = "swiftInterop"
|
||||
commonSrcDirs = listOf("$toolsPath/benchmarks/shared/src/main/kotlin/report", "src", "../shared/src/main/kotlin")
|
||||
@@ -20,6 +20,5 @@ swiftBenchmark {
|
||||
swiftSources = listOf("$projectDir/swiftSrc/benchmarks.swift", "$projectDir/swiftSrc/main.swift")
|
||||
compileTasks = listOf("compileKotlinNative", "linkBenchmarkReleaseFrameworkNative")
|
||||
buildType = (findProperty("nativeBuildType") as String?)?.let { NativeBuildType.valueOf(it) } ?: defaultBuildType
|
||||
|
||||
dependencies.common(project(":endorsedLibraries:kotlinx.cli"))
|
||||
cleanBeforeRunTask = "compileKotlinNative"
|
||||
}
|
||||
Reference in New Issue
Block a user