netty5/codec-stomp/src
Nikolay Fedorovskikh 4875a2aad4 Immediate caching the strings wrapped to AsciiString
Motivation:
The `AsciiString#toString` method calculate string value and cache it into field. If an `AsciiString` created from the `String` value, we can avoid rebuilding strings if we cache them immediately when creating `AsciiString`. It would be useful for constants strings, which already stored in the JVMs string table, or in cases where an unavoidable `#toString `method call is assumed.

Modifications:
- Add new static method `AsciiString#cache(String)` which save string value into cache field.
- Apply a "benign" data race in the `#hashCode` and `#toString` methods.

Result:
Less memory usage in some `AsciiString` use cases.
2017-08-15 06:22:14 +02:00
..
main/java/io/netty/handler/codec/stomp Immediate caching the strings wrapped to AsciiString 2017-08-15 06:22:14 +02:00
test/java/io/netty/handler/codec/stomp Fix buffer leaks in tests 2016-12-03 20:11:25 +01:00