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.
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -5,6 +5,7 @@ build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea/**
|
||||
.idea/modules.xml
|
||||
.idea/jarRepositories.xml
|
||||
.idea/compiler.xml
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user