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

Custom JsonGenerator with optimized writeObject() for simple object types #728

Merged
merged 2 commits into from
Jan 5, 2022

Commits on Dec 28, 2021

  1. Custom JsonGenerator with optimized writeObject() for simple object t…

    …ypes
    
    Wrap the JsonGenerator with an optimized version of the writeObject() method that tries to call the appropriate write() method for the giveb untype Object and delegate to the underlying JsonGenerator as fallback.
    
    Without this optimisation the writeObject() delegates to the underlying Codec which is less effective for simple types (String, Numbers, Boolean, byte[], JsonNode, etc) both in terms of CPU and temporary memory allocations.
    
    Until now only the AbstractJsonPatternParser was using this optimisation. This commit moves it directly inside the JsonGenerator so it can benefit to any JsonProvider.
    brenuart committed Dec 28, 2021
    Configuration menu
    Copy the full SHA
    864a875 View commit details
    Browse the repository at this point in the history
  2. Add missing test cases

    brenuart committed Dec 28, 2021
    Configuration menu
    Copy the full SHA
    151a11e View commit details
    Browse the repository at this point in the history