Skip to content

Commit 0b63d14

Browse files
authored
Merge pull request #77 from halotukozak-com/perf/json-write-buffer
perf(json): pre-size Json.write's StringBuilder
2 parents 3dcbcf6 + 1c52478 commit 0b63d14

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/mcodec/Json.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ object Json:
88
value
99

1010
def write[T: MCodec as codec](value: T): String =
11-
val sb = new java.lang.StringBuilder
11+
val sb = new java.lang.StringBuilder(512)
1212
codec.write(new JsonOutput(sb), value)
1313
sb.toString

0 commit comments

Comments
 (0)