Thanks to visit codestin.com
Credit goes to github.com

Skip to content

why to remove the string version json search parameter #3365

@cjdxhjj

Description

@cjdxhjj

Currently, lettuce has a strong dependency on Jackson. If you have previously used JSONB, JSONP, FastJSON, or Kotlin-serialize, then you must rely on Jackson. The version with string-type parameters has been removed. The getJsonParser() method must be run within a function each time, and the parse method constructs an ObjectMapper each time, which is a very slow operation and also wastes memory. The args are first converted into strings, then into byte arrays, and then wrapped with ByteBuffer, and finally the array is retrieved. The string version only needs a getBytes() operation. If you want to verify the validity of the JSON, you can use a similar encapsulation as JsonPath to check the validity of the JSON, without introducing other dependencies and without incurring a lot of performance-wasting overheads.

Image

Image

Image

https://stackoverflow.com/questions/57670466/objectmapper-best-practice-for-thread-safety-and-performance

Image

Image

Sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions