Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b50
    • CPU:
      generic
    • OS:
      generic

      Backports

        Description

        Mostly the property handling seems to be a bottleneck. For small JSON objects, we have only 1-2 properties, but the findElement in PropertyHashMap then becomes a bottleneck.

        For larger objects, the general property handling also takes time. The various JSON function are also implemented "by spec" for compliance and could use optimization work. Parsing/lexing JSON also takes a lot of time. We should probably add JSON to the code cache or serialize JSON objects or something.

        One (rather messy) way to do it, is to treat constant property map literals for JSON such as the FieldObjectCreator does -generate bytecode with putfields.

        Hannes says: I think for property maps the key is to use spill - we can populate the object much easier, and accessors are cached already (Marcus comments: but all defineOwnProperty that JSON.parse does already create spill properties?)

        Hannes also says: well we use the ScriptObject API. We should use some bulk methods to create properties and maps. (good idea)

        Now with my concat fix checked in you can use

        https://github.com/ysangkok/js-clrs-btree

        as a JSON benchmark. All it does is parse assorted JSON in various forms.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  hannesw Hannes Wallnoefer
                  Reporter:
                  lagergren Marcus Lagergren
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: