From d671fbd64b7ba0011ecc7c4683ff7785c160e330 Mon Sep 17 00:00:00 2001 From: rnentjes Date: Wed, 9 Apr 2025 20:45:39 +0200 Subject: [PATCH] Update Kotlin version, refine .gitignore, and optimize tests Upgraded Kotlin Multiplatform plugin to version 2.1.20 for better compatibility and feature enhancements. Adjusted .gitignore to include `.idea/**` for broader IntelliJ configuration exclusion. Increased test iteration count in `TestCachedString` to improve benchmarking precision. --- .gitignore | 1 + build.gradle.kts | 2 +- readme.md | 1 - src/jvmTest/kotlin/nl/astraeus/tba/TestCachedString.kt | 6 +++--- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index eeffbfa..bea213b 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ build/ !**/src/test/**/build/ ### IntelliJ IDEA ### +.idea/** .idea/modules.xml .idea/jarRepositories.xml .idea/compiler.xml diff --git a/build.gradle.kts b/build.gradle.kts index 5dd8c8d..38c0425 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - kotlin("multiplatform") version "2.1.0" + kotlin("multiplatform") version "2.1.20" `maven-publish` signing id("org.jetbrains.dokka") version "1.5.31" diff --git a/readme.md b/readme.md index 44e190c..426b646 100644 --- a/readme.md +++ b/readme.md @@ -46,4 +46,3 @@ When such a type is updated, for example we update a string with a shorter strin Strings are stored as UTF-8 bytes, there is also a CachedStringProperty which will keep a copy of the string so it isn't converted to a native string every time it's accessed. - diff --git a/src/jvmTest/kotlin/nl/astraeus/tba/TestCachedString.kt b/src/jvmTest/kotlin/nl/astraeus/tba/TestCachedString.kt index 50d125e..85246d5 100644 --- a/src/jvmTest/kotlin/nl/astraeus/tba/TestCachedString.kt +++ b/src/jvmTest/kotlin/nl/astraeus/tba/TestCachedString.kt @@ -25,7 +25,7 @@ class TestCachedString { notCachedPerson.name = "A Longer Longer Longer Longer Longer Test" var total = 0 - repeat(1000000) { + repeat(10000000) { total += cachedPerson.name.hashCode() total += notCachedPerson.name.hashCode() } @@ -34,14 +34,14 @@ class TestCachedString { var start1 = System.nanoTime() var total1 = 0 - repeat(1000000) { + repeat(10000000) { total1 += cachedPerson.name.hashCode() } val stop1 = System.nanoTime() var start2 = System.nanoTime() var total2 = 0 - repeat(1000000) { + repeat(10000000) { total2 += notCachedPerson.name.hashCode() } val stop2 = System.nanoTime()