Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-6546

Improve parser speeds of Groovy JSON parser while maintaining backward compatability

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 2.3.0-beta-1
    • None
    • None

    Description

      This was discussed on the mailing list and in private conversations.
      The basic plan is to take some of the ideas in the Boon JSON parser and add them to Groovy.

      Groovy will not depend on Boon. The 2 to five classes will be moved over to Groovy.

      A later effort, if approved, will move over the Java Object to JSON serialization work done in Boon (@JsonProperty, @JsonView, etc.).

      This is only a small part of the Boon JSON parsing because a large part of the Boon effort is to map JSON to Java objects, and Groovy already allows easy conversion from Maps to Java objects.

      Boon style JSON parser may suite Groovy well because it has a intermediate state of Object Tree that looks like a Map but is actually a hierarchy of Value objects which are index overlay objects.

      More about Boon JSON parse can be found here:

      https://github.com/RichardHightower/boon/wiki/Boon-JSON-in-five-minutes#processing-model-data-binding

      Early benchmarks appear that the new Boon style JSON parser for in-memory parse would be around 2x to 5x faster than common, popular JSON parsers and 20x or so faster than existing Groovy parser.

      Some effort was made to create a large file parser bc Boon was initially just for REST/Websocket JSON consumption (streaming mode if you will). Boon created a windowing buffer parser so that it could better support this migration. Although created in the Boon project, the intended target of the windowing buffer was Groovy.

      Under 2MB files will use the in-memory parser by default, about 2MB will use the windowing buffer by default.

      More details in mailing list just search for JSON Groovy Benchmark.

      Attachments

        Activity

          People

            melix Cédric Champeau
            richardhightower Richard Hightower
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 168h
                168h
                Remaining:
                Remaining Estimate - 168h
                168h
                Logged:
                Time Spent - Not Specified
                Not Specified