Skip to content

Commit 401a15d

Browse files
committed
Tune load factor for more efficient parsing of java.time.ZoneId and java.time.ZonedDateTime values with JVMs and Scala Native
1 parent f35aa00 commit 401a15d

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

  • jsoniter-scala-core
    • js/src/main/scala/com/github/plokhotnyuk/jsoniter_scala/core
    • jvm-native/src/main/scala/com/github/plokhotnyuk/jsoniter_scala/core

jsoniter-scala-core/js/src/main/scala/com/github/plokhotnyuk/jsoniter_scala/core/JsonReader.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4482,7 +4482,7 @@ object JsonReader {
44824482
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
44834483
)
44844484
private final val zoneOffsets: Array[ZoneOffset] = new Array(145)
4485-
private final val zoneIds: ConcurrentHashMap[Key, ZoneId] = new ConcurrentHashMap(256)
4485+
private final val zoneIds: ConcurrentHashMap[Key, ZoneId] = new ConcurrentHashMap(256, 0.5f)
44864486
private final val hexDigits: Array[Char] =
44874487
Array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f')
44884488
/* Use the following code to generate `dumpBorder` in Scala REPL:

jsoniter-scala-core/jvm-native/src/main/scala/com/github/plokhotnyuk/jsoniter_scala/core/JsonReader.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5113,7 +5113,7 @@ object JsonReader {
51135113
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
51145114
)
51155115
private final val zoneOffsets: Array[ZoneOffset] = new Array(145)
5116-
private final val zoneIds: ConcurrentHashMap[Key, ZoneId] = new ConcurrentHashMap(256)
5116+
private final val zoneIds: ConcurrentHashMap[Key, ZoneId] = new ConcurrentHashMap(256, 0.5f)
51175117
private final val hexDigits: Array[Char] =
51185118
Array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f')
51195119
/* Use the following code to generate `dumpBorder` in Scala REPL:

0 commit comments

Comments
 (0)