Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

LiquidBounce Forum

  1. Home
  2. General Discussion
  3. A Simple Benchmark Performance Test for LiquidBounce's ScriptAPI

A Simple Benchmark Performance Test for LiquidBounce's ScriptAPI

Scheduled Pinned Locked Moved General Discussion
9 Posts 3 Posters 1.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • CookieChineseC Offline
    CookieChineseC Offline
    CookieChinese
    wrote on last edited by CookieChinese
    #1

    Author: mumy

    Introduction

    Since LiquidBounce switched its ScriptAPI language to JavaScript from version b57, it has provided powerful extensibility. However, the community has not conducted a specific performance evaluation on it. Recently, I realized this gap and decided to perform a simple benchmark to assess its performance.

    Test

    I plan to divide the scripts into two categories: Standard Scripts and Hybrid Scripts (e.g., mumyPacketDebugger). The tests will include Fibonacci numbers, the Sieve of Eratosthenes, and block scanning in the world. For the Nextgen version, tests will be conducted using ZuluJDK and GraalVM.

    The final result will be based on the shortest time taken after the runtime stabilizes.

    Script

    Benchmark for legacy b99 and nextgen 0.24.zip

    Platform

    • OS: Windows 10 22H2
    • CPU: Intel i9-14900HX (locked at 5.0GHz)
    • RAM: DDR5 16GB + 16GB 5600MHz

    Environment

    • Legacy
      • Version: b99
      • JDK: ZuluJDK 8
      • Minecraft: Forge 1.8.9 + OptiFine M5
    • Nextgen
      • Version: 0.24
      • JDK: ZuluJDK 21 / GraalVM 21
      • Minecraft: Fabric 1.21.4 + Sodium 0.6.6

    Results

    Legacy

    Test Case Fibonacci Sieve of Eratosthenes World Scanner
    Standard Script 149ms 61482ms 1539ms
    Hybrid Script 59ms 1147ms 311ms

    Nextgen

    Test Case Fibonacci Sieve of Eratosthenes World Scanner
    Standard Script + ZuluJDK 9890ms 9629ms 9368ms
    Standard Script + GraalVM 144ms 1277ms 1952ms
    Hybrid Script + ZuluJDK 67ms 1023ms 195ms
    Hybrid Script + GraalVM 52ms 982ms 177ms

    Conclusion

    There are some special versions of LiquidBounce that I haven't tested, but most of them are outdated and have limited reference value (e.g., Legacy-b73 1.12.2 or Nextgen 0.17, which didn't yet support GraalJS JIT).

    For the Legacy version, since Nashorn has been used as the Script engine since b57, theoretically, there are no significant performance differences across versions.

    For Nextgen, if you don't use GraalVM to launch LiquidBounce, you may experience lag when running standard scripts. I recommend using LiquidLauncher to solve this issue.

    1 Reply Last reply
    0
    • C Offline
      C Offline
      commandblock2
      wrote on last edited by commandblock2
      #2

      Looks quite unexpected to me that for Fibonacci the performance is worse for the graaljs compared to nashorn. Also from my side, using

      //@ts-ignore
      blocks.push(mc.theWorld.func_180495_p(blockPos.func_181079_c(x, y, z)));
      

      vs

      //@ts-ignore
      blocks.push(mc.world.getBlockState(blockPos.set(x, y, z)));
      

      does not look the same to me because the later involves remapping (which may lower it's performance). I am quite curious why in the script for Legacy b99 you used the srg names instead of mcp names, is the remapping for Legacy broken now? (haven't launched Legacy version for a long time myself)

      CookieChineseC 1 Reply Last reply
      0
      • C commandblock2

        Looks quite unexpected to me that for Fibonacci the performance is worse for the graaljs compared to nashorn. Also from my side, using

        //@ts-ignore
        blocks.push(mc.theWorld.func_180495_p(blockPos.func_181079_c(x, y, z)));
        

        vs

        //@ts-ignore
        blocks.push(mc.world.getBlockState(blockPos.set(x, y, z)));
        

        does not look the same to me because the later involves remapping (which may lower it's performance). I am quite curious why in the script for Legacy b99 you used the srg names instead of mcp names, is the remapping for Legacy broken now? (haven't launched Legacy version for a long time myself)

        CookieChineseC Offline
        CookieChineseC Offline
        CookieChinese
        wrote on last edited by
        #3

        @commandblock2 (by-mumy)
        Yes, the remapper for Legacy b99 is broken, but it only affects the function name mapping, while the field names remain unaffected. This issue has led to the use of srg function names instead of mcp function names in the Legacy scripts.

        EclipsesDevE 1 Reply Last reply
        0
        • CookieChineseC CookieChinese

          @commandblock2 (by-mumy)
          Yes, the remapper for Legacy b99 is broken, but it only affects the function name mapping, while the field names remain unaffected. This issue has led to the use of srg function names instead of mcp function names in the Legacy scripts.

          EclipsesDevE Offline
          EclipsesDevE Offline
          EclipsesDev
          Moderator
          wrote on last edited by
          #4

          @CookieChinese only b99? if so then could u maybe test the b99 build commit before b8ff415

          CookieChineseC 1 Reply Last reply
          0
          • EclipsesDevE EclipsesDev

            @CookieChinese only b99? if so then could u maybe test the b99 build commit before b8ff415

            CookieChineseC Offline
            CookieChineseC Offline
            CookieChinese
            wrote on last edited by CookieChinese
            #5

            @EclipsesDev (by-mumy)
            I tested using the b98 release, and its remapper is working properly, allowing the use of MCP names.

            //@ts-ignore
             blocks.push(mc.theWorld.getBlockState(blockPos.set(x, y, z)));
            

            And the results:

            Test Case Fibonacci Sieve of Eratosthenes World Scanner
            Standard Script 152ms 60056ms 1482ms

            Due to the theoretically small performance difference in hybrid scripts, testing is no longer conducted.

            EclipsesDevE 1 Reply Last reply
            0
            • CookieChineseC CookieChinese

              @EclipsesDev (by-mumy)
              I tested using the b98 release, and its remapper is working properly, allowing the use of MCP names.

              //@ts-ignore
               blocks.push(mc.theWorld.getBlockState(blockPos.set(x, y, z)));
              

              And the results:

              Test Case Fibonacci Sieve of Eratosthenes World Scanner
              Standard Script 152ms 60056ms 1482ms

              Due to the theoretically small performance difference in hybrid scripts, testing is no longer conducted.

              EclipsesDevE Offline
              EclipsesDevE Offline
              EclipsesDev
              Moderator
              wrote on last edited by
              #6

              @CookieChinese should be fixed in latest nightly build https://github.com/CCBlueX/LiquidBounce/pull/5406 pls try again

              MukjepScarlet opened this pull request in CCBlueX/LiquidBounce

              closed fix(legacy): Remapper (caused by #4995) #5406

              CookieChineseC 1 Reply Last reply
              0
              • EclipsesDevE EclipsesDev

                @CookieChinese should be fixed in latest nightly build https://github.com/CCBlueX/LiquidBounce/pull/5406 pls try again

                MukjepScarlet opened this pull request in CCBlueX/LiquidBounce

                closed fix(legacy): Remapper (caused by #4995) #5406

                CookieChineseC Offline
                CookieChineseC Offline
                CookieChinese
                wrote on last edited by
                #7

                @EclipsesDev (by mumy)
                The test results show a performance difference of less than 1% compared to b98, and the remapper is working correctly.
                (legacy b100 git-99f4b13)

                1 Reply Last reply
                0
                • EclipsesDevE Offline
                  EclipsesDevE Offline
                  EclipsesDev
                  Moderator
                  wrote on last edited by
                  #8

                  alright good to know

                  1 Reply Last reply
                  0
                  • C Offline
                    C Offline
                    commandblock2
                    wrote on last edited by commandblock2
                    #9

                    Dev environment

                    [02:09:47] [Render thread/INFO] (Minecraft) [System] [CHAT] LiquidBounce ▸ Fibonacci [time: 23306ms, value: 39088169]
                    [02:09:47] [Render thread/INFO] (Minecraft) [System] [CHAT] LiquidBounce ▸ SieveEratosphen [time: 46371ms, value: 49999991]
                    [02:09:47] [Render thread/INFO] (Minecraft) [System] [CHAT] LiquidBounce ▸ WorldScanner [time: 28334ms, value: 10302255]
                    

                    Production environment

                    [02:41:41] [Render thread/INFO]: [System] [CHAT] LiquidBounce ▸ Fibonacci [time: 1571867ms, value: 39088169]
                    [02:41:41] [Render thread/INFO]: [System] [CHAT] LiquidBounce ▸ SieveEratosphen [time: 46668ms, value: 49999991]
                    [02:41:41] [Render thread/INFO]: [System] [CHAT] LiquidBounce ▸ WorldScanner [time: 28094ms, value: 10302255]
                    

                    Both using i7-9750H, 32G DDR4 RAM with OpenJDK on Linux with Nextgen. Standard script only.

                    Fibonacci in development environment is significantly faster than production environment. (23s vs 1571s)

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    About
                    • Terms of Service
                    • Privacy Policy
                    • Status
                    • Contact Us
                    Downloads
                    • Releases
                    • Source code
                    • License
                    Docs
                    • Tutorials
                    • CustomHUD
                    • AutoSettings
                    • ScriptAPI
                    Community
                    • Forum
                    • Guilded
                    • YouTube
                    • Twitter
                    • D.Tube
                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups