You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: changelog.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
### Revision History
2
2
3
3
#### 4.99.0 (Unreleased)
4
-
***FEATURE**: New `StringUtilities.getChars(String s)` — public API that returns a ThreadLocal `char[]` buffer populated via `String.getChars()` (SIMD-optimized bulk copy). Callers replace `str.charAt(i)` loops with direct `buf[i]` array access, avoiding per-character method call and JDK 9+ coder check overhead. Applied across `StringUtilities` (`trimLength`, `hexStringToByteArray`, `count`, `levenshteinDistance`, `damerauLevenshteinDistance`, `snakeToCamel`, `camelToSnake`, `isNumeric`), `ByteUtilities.decode`, `MathUtilities.smartNumberParse`, and `DateUtilities` (`validateSecure`, `parseNanosecond`, `parseTimeZone`, `removeDateMarkerCharacters`).
4
+
***FEATURE**: New `StringUtilities.getChars(String s)` — public API that returns a ThreadLocal `char[]` buffer populated via `String.getChars()` (SIMD-optimized bulk copy). Callers can replace `str.charAt(i)` loops with direct `buf[i]` array access, avoiding per-character method call and JDK 9+ coder check overhead. Use `s.length()` for the valid range. Buffer is shared per-thread — valid until the next `getChars()` call on the same thread.
5
5
***PERFORMANCE**: `StringUtilities.hashCodeIgnoreCase(String)` — uses `StringUtilities.getChars()` (SIMD-optimized bulk copy) into a ThreadLocal `char[]` buffer, then hashes from the array directly. Avoids `charAt()`'s per-character method call and JDK 9+ compact-string coder check overhead. No reflection, no VarHandle, no `--add-opens` — works on all JDK versions (8-25+). Benchmark shows CaseInsensitiveMap GET improved **70-75%** (230 → 58-69 ns/op), PUT improved **48-52%** (135 → 65-71 ns/op), and MIXED-CASE GET improved **68%** (302 → 93-97 ns/op) on 100K entries.
6
6
***PERFORMANCE**: New `FastReader.readLine(char[] dest, int off, int maxLen)` — dedicated line-reading method optimized for TOON's line-oriented parsing. Combines scanning, copying, and line-ending consumption (`\n`, `\r`, `\r\n`) into a single call. Uses a `c <= '\r'` range guard so printable characters (the vast majority) require only one comparison per character instead of two. Eliminates the per-line overhead of separate `readUntil()` + `read()` + pushback round-trip. JFR shows TOON line-reading samples dropped from 173 to 125 (28% reduction), and `FastReader.read()` calls halved (53 → 25 samples).
7
7
***PERFORMANCE**: `FastReader.readUntil()` pushback drain loop now uses a local variable for `pushbackPosition` instead of repeated member field access, avoiding load/store through `this` on each iteration. JFR shows 14.8% reduction in aggregate FastReader CPU share.
0 commit comments