Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8011629

Object.defineProperty performance issue

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 8
    • 8
    • core-libs
    • None
    • b100
    • generic
    • generic

      Object.defineProperty is ultra slow. Test case attached. I am adding 1 property to a fresh object 3000000 times. It takes 20 seconds with Object.defineProperty, 0.8 sec without.

      90% of the time is spent in jdk.nashorn.internal.runtime.ScriptObject.deleteObject (called from jdk.nashorn.internal.objects.NativeObject.defineProperty) although my objects are fresh, no state to delete (I guess).

        1. slow5.js
          0.4 kB
          Jean-Francois Denise

            jlaskey Jim Laskey
            jfdenise Jean-Francois Denise (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: