Configuration for com.github.plokhotnyuk.jsoniter_scala.core.JsonReader that contains flags for tuning of
parsing exceptions and preferred sizes for internal buffers that are created on the reader instantiation and reused
in runtime for parsing of messages.
All configuration params already initialized by recommended default values, but in some cases they should be altered
for performance reasons:
-
turn off stack traces for parsing exceptions to greatly reduce impact on performance for cases when exceptions can be not exceptional (e.g. under DoS attacks over open to the world systems), see more details here: https://shipilev.net/blog/2014/exceptional-performance/
-
turn off appending of hex dump to minimize length of exception message
-
increase preferred size of an internal byte buffer for parsing from java.io.InputStream or java.nio.DirectByteBuffer to reduce allocation rate of grown and then reduced buffers during parsing of large (>16Kb) numbers (including stringified), raw values, or ADT instances with the discriminator field doesn't appear in the beginning of the JSON object
-
increase preferred size of an internal char buffer to reduce allocation rate of grown and then reduced buffers when large (>4Kb) string instances need to be parsed including those one which use Base16 or Base64 encodings
Attributes
- appendHexDumpToParseException
a flag that allows to turn off hex dumping of affected by error part of an internal byte buffer
- checkForEndOfInput
a flag to check and raise an error if some non whitespace bytes will be detected after successful parsing of the value
- hexDumpSize
a size of the hex dump in 16-byte lines before and after the 16-byte line where an error occurs
- maxBufSize
a max size (in bytes) of an internal byte buffer when parsing from java.io.InputStream or java.nio.DirectByteBuffer
- maxCharBufSize
a max size (in chars) of an internal char buffer for parsing of string values including those one which use Base16 or Base64 encodings
- preferredBufSize
a preferred size (in bytes) of an internal byte buffer when parsing from java.io.InputStream or java.nio.DirectByteBuffer
- preferredCharBufSize
a preferred size (in chars) of an internal char buffer for parsing of string values
- throwReaderExceptionWithStackTrace
a flag that allows to turn on a stack traces for debugging purposes in development
- Companion:
- object
- Graph
- Supertypes
- trait Serializableclass Objecttrait Matchableclass Any
- Known subtypes
- object ReaderConfig.type