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

Performance regression after migrating JavaFX from Unsafe to FFM

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3 P3
    • tbd
    • 25
    • core-libs
    • None

      The performance of FFM getInt and putInt is significantly low compared to Unsafe getInt and putInt.

      Attaching programs that print the time taken by these methods, with FFM and Unsafe.
      The programs perform 100_000_000 put and get calls and prints the total time in ms.

      Output of the programs with JDK 24 and 25 are as:

      JDK 24.0.1+9
         FFM getInt() time: 25.182ms
      Unsafe.getInt() time: 5.740ms
         FFM putInt() time: 43.266ms
      Unsafe.putInt() time: 6.169ms

      JDK 25-ea+30
         FFM getInt() time: 17.230ms
      Unsafe.getInt() time: 5.977ms
         FFM putInt() time: 22.364ms
      Unsafe.putInt() time: 6.460ms

      The performance is improved with 25 compared to 24.0.1

        1. FFMGetInt.java
          0.9 kB
        2. FFMPutInt.java
          0.8 kB
        3. UnsafeGetInt.java
          0.8 kB
        4. UnsafePutInt.java
          0.8 kB

            pminborg Per-Ake Minborg
            arapte Ambarish Rapte
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: