1. Groovy
  2. GROOVY-6546

Improve parser speeds of Groovy JSON parser while maintaining backward compatability


    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.3.0-beta-1
    • Component/s: None
    • Labels:


      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:

      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.


        Richard Hightower created issue -
        Cédric Champeau added a comment -

        Merged your PR. Thank you very much for this contribution!

        Cédric Champeau added a comment - Merged your PR. Thank you very much for this contribution!
        Cédric Champeau made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Fix Version/s 2.3.0 [ 19608 ]
        Assignee Cedric Champeau [ melix ]
        Paul King made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Mark Thomas made changes -
        Project Import Sun Apr 05 13:32:57 UTC 2015 [ 1428240777691 ]
        Mark Thomas made changes -
        Workflow jira [ 12735457 ] Default workflow, editable Closed status [ 12747183 ]
        Mark Thomas made changes -
        Project Import Mon Apr 06 02:11:23 UTC 2015 [ 1428286283443 ]
        Mark Thomas made changes -
        Workflow jira [ 12973892 ] Default workflow, editable Closed status [ 12981056 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        5d 2h 42m 1 Cédric Champeau 06/Feb/14 15:39
        Resolved Resolved Closed Closed
        57d 8h 21m 1 Paul King 05/Apr/14 00:00


          • Assignee:
            Cédric Champeau
            Richard Hightower
          • Votes:
            0 Vote for this issue
            2 Start watching this issue


            • Created:

              Time Tracking

              Original Estimate - 168h
              Remaining Estimate - 168h
              Time Spent - Not Specified
              Not Specified