This repository was archived by the owner on Oct 31, 2024. It is now read-only.
Merged
Conversation
Contributor
There was a problem hiding this comment.
Isn't this the same as return rawJson?
Collaborator
Author
There was a problem hiding this comment.
Well... when you put it like that... yes.
There's no point in creating the string for every call to #search, it can be created once and only once.
Converting strings from T to String is a big performance problem, and this eliminates one of the biggest culprits. Adapter#getProperty(T,String) is no longer used after this change, so it's deprecated. This has no impact at all for the JUC runtime, but possibly a small negative impact for the Jackson runtime, since it's JsonNode#get expects a string and not a JsonNode. Hopefully StringNode#textValue doesn't do any conversions. For the upcoming JRuby implementation this is a huge performance optimization though, since it doesn't use Java strings internally.
Mostly to make it work like StringNode and PropertyNode.
… arrays This is not an optimization in itself, but it makes it easier for runtimes to reuse existing comparator implementations.
Short circuit when the number of keys are not equal, and then only check that one set of keys contains the other (since they are the same number this is enough).
To be consistent with how the other node types are compared. Node#equals is really only used for the parser tests, so it's not a big deal. Unfortunately some tests of unescaping were in the parser tests and should be in the runtime tests instead. Since I touched all of the parser tests I took the opportunity to rewrite them as specdoc-esque sentences.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I'm working on a JRuby runtime and while doing that I've found a few simple changes that do wonders. It's mostly to avoid string allocations and conversions, which are costly in JRuby.
There are many, many other optimizations that can be done, these are only a few quick ones.