Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8006950 Investigate Array initialization overhead
  3. JDK-8019157

Avoid calling ScriptObject.setProto() if possible

    XMLWordPrintable

Details

    • Sub-task
    • Resolution: Fixed
    • P4
    • 8
    • 8
    • core-libs
    • None

    Description

      Calling ScriptObject.setProto() is quite expensive. One expensive part is invalidating the object's property map, which involves a WeakHashMap lookup in PropertyMap.checkProtoHistory().

      Invaliding the property map is necessary if the property map may be in use with other prototypes. However, many built-in objects including arrays (in fact all built-ins except for Object) are always constructed with the same combination of prototype and property map.

      In this case we can significantly improve object creation overhead by providing a way to directly set both prototype and property map.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: