Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate allowing UTF8StreamJsonParser to be used without canonicalization (see #994) #995

Open
wants to merge 1 commit into
base: 2.16
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -259,6 +259,11 @@ public JsonParser constructParser(int parserFeatures, ObjectCodec codec,
if (enc == JsonEncoding.UTF8) {
/* and without canonicalization, byte-based approach is not performant; just use std UTF-8 reader
* (which is ok for larger input; not so hot for smaller; but this is not a common case)
* 5-May-2023, ckozak [core#994]: The reader-based implementation under-performs for small inputs
* due to the initialization cost of InputStreamReader which allocates a new 8KiB buffer. Normalizing
* benchmarks for that fixed cost, ReaderBasedJsonParser maintains a performance edge in tested scenarios.
* Notes from this investigation can be found here:
* https://github.com/FasterXML/jackson-core/pull/995#issuecomment-1523912770
*/
if (JsonFactory.Feature.CANONICALIZE_FIELD_NAMES.enabledIn(factoryFeatures)) {
ByteQuadsCanonicalizer can = rootByteSymbols.makeChild(factoryFeatures);
Expand Down