Git Product home page Git Product logo

gds-syntax-benchmark's Introduction

GDScript Syntax Benchmarks

Speed comparisons of various syntax alternatives within the GDScript language (Godot game engine). All code is within benchmarks.gd, including funcs referenced in results table.

SEE THE END OF THIS README FOR THE RESULTS TABLE

To Run Tests Yourself

  • Open the project in Godot
  • Click the lone node in the Scene/Node panel
  • Click the unchecked box in the Inspector for the exported variable 'Click To Run'
  • Wait several seconds for the tests to run (Godot editor may appear frozen during this time)

The script is a 'tool' and clicking this exported variable will trigger a setget function which actually runs the tests. The results will be printed in the standard output and written to your disk as README.md (clobbering the existing README.md)

Contributors

Please only add benchmarks.gd to your commits. This entire readme file is automaticaly generated by the script, so please do not commit changes to the readme itself. Thanks!

Results

Godot version: 3.1-stable (official)

    array_index  ***  49% faster than ***  array_append    (0.246 vs 0.367 sec)
      array_len  ***   4% faster than ***  array_size      (0.229 vs 0.237 sec)
    array_izero  ***  16% faster than ***  array_front     (0.207 vs 0.241 sec)
     array_ineg  ***  10% faster than ***  array_back      (0.212 vs 0.233 sec)
       var_func  ***   7% faster than ***  var_script      (0.170 vs 0.182 sec)
     var_script  ***  29% faster than ***  var_self        (0.189 vs 0.244 sec)
   iter_for_int  ***  26% faster than ***  iter_for_range  (0.334 vs 0.422 sec)
       iter_for  *** 121% faster than ***  iter_while      (0.114 vs 0.252 sec)
            ifs  ***  21% faster than ***  matches         (0.446 vs 0.537 sec)
 array_appendrw  ***   7% faster than ***  parray_appendrw (0.720 vs 0.772 sec)
   dontcallfunc  *** 227% faster than ***  callfunc        (0.115 vs 0.375 sec)
   inteval_auto  ***  58% faster than ***  inteval         (0.158 vs 0.249 sec)
 arrayeval_auto  *** 221% faster than ***  arrayeval       (0.162 vs 0.520 sec)
  dicteval_auto  *** 220% faster than ***  dicteval        (0.157 vs 0.501 sec)
  nulleval_auto  ***  54% faster than ***  nulleval        (0.155 vs 0.239 sec)

gds-syntax-benchmark's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.