• Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Icon: P3 P3
    • 9
    • 9
    • core-libs
    • None
    • b50
    • generic
    • generic

        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.

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

                Created:
                Updated:
                Resolved: