java icon indicating copy to clipboard operation
java copied to clipboard

[WIP] Fully-functional Slices

Open Miha-x64 opened this issue 7 years ago • 3 comments

Slices may be always used instead of Strings. They can be read fast way, when there are no multibyte chars or escape sequences, or slow way, with String allocation.

Not done yet: String deduplication (less allocations), especially when parsing big lists of objects with similar structure.

Miha-x64 avatar Mar 04 '18 21:03 Miha-x64

slice is good when the input is byte array, and there is not unicode or escape. when the input is a input stream, the allocation can not be avoided.

taowen avatar Mar 05 '18 01:03 taowen

In your variant reading slices may not succeed. For example, enum decoder reads a Slice without any fallback. But enum constant may contain non-unicode characters, while, for instance, PHP's json_encode function encodes such characters using \uXXXX.

Miha-x64 avatar Mar 06 '18 17:03 Miha-x64

Very strange. Tests, failing on Travis, are working correctly on my computer. Except ones with Streaming Category which failing on enableStreamingSupport with Javassist errors.

Miha-x64 avatar Mar 11 '18 08:03 Miha-x64