Skip to content

Commit

Permalink
Added documentation about performance measurement (JetBrains#2719)
Browse files Browse the repository at this point in the history
  • Loading branch information
LepilkinaElena authored Feb 27, 2019
1 parent 61055e2 commit 8cc6e67
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 2 deletions.
58 changes: 57 additions & 1 deletion HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,60 @@ To update the blackbox compiler tests set TeamCity build number in `gradle.prope

* **-Ptest_verbose** enables printing compiler args and other helpful information during a test execution.

./gradlew -Ptest_verbose :backend.native:tests:mpp_optional_expectation
./gradlew -Ptest_verbose :backend.native:tests:mpp_optional_expectation
## Performance measurement

Firstly, it's necessary to build analyzer tool to have opportunity to compare different performance results:

cd tools/benchmarksAnalyzer
../../gradlew build

To measure performance of Kotlin/Native compiler on existing benchmarks:

cd performance
../gradlew konanRun

**konanRun** task can be run separately for one/several benchmark applications:

../gradlew :cinterop:konanRun

**konanRun** task has parameter `filter` which allows to run only some subset of benchmarks :

../gradlew :cinterop:konanRun --filter=struct,macros

There are also tasks for running benchmarks on JVM (pay attention, some benchmarks e.g. cinterop benchmarks can't be run on JVM)

../gradlew jvmRun

Files with results of benchmarks run are saved in `performance/build`. **nativeReport.json** - for konanRun and **jvmReport.json** for jvmRun.

To compare different results run benchmarksAnalyzer tool:

cd tools/benchmarksAnalyzer/build/bin/<target>/benchmarksAnalyzerReleaseExecutable/
./benchmarksAnalyzer.kexe <file1> <file2>

Tool has several renders which allow produce output report in different forms (text, html, etc.). To set up render use flag `-render/-r`.
Output can be redirected to file with flag `-output/-o`.
To get detailed information about supported options, please use `-help/-h`.

Analyzer tool can compare both local files and files placed on Bintray/TeamCity.

File description stored on Bintray

bintray:<build number>:<target (Linux|Windows10|MacOSX)>:<filename>

Example

bintray:1.2-dev-7942:Windows10:nativeReport.json

File description stored on TeamCity

teamcity:<build locator>:<filename>
Example

teamcity:id:42491947:nativeReport.json

Pay attention, user and password information(with flag `-u <username>:<password>`) should be provided to get data from TeamCity.

2 changes: 1 addition & 1 deletion tools/benchmarksAnalyzer/src/main/kotlin/main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ object TeamCityConnector: Connector() {
val fileName = fileDescription.substringAfterLast(':')
if (fileDescription == fileLocation ||
fileDescription == buildLocator || fileName == fileDescription) {
error("To get file from bintray, please, specify, build number from TeamCity and target" +
error("To get file from TeamCity, please, specify, build locator and filename on TeamCity" +
" in format teamcity:build_locator:filename")
}
val accessFileUrl = "$teamCityUrl/app/rest/builds/$buildLocator/artifacts/content/$fileName"
Expand Down

0 comments on commit 8cc6e67

Please sign in to comment.