Up to date

This page is up to date for NumDot stable. If you still find outdated information, please open an issue.

Alternatives to NumDot

If you want to use fast tensor math in godot, there are alternative approaches you can take. This article lists your options, and describes the differences.

If you need help deciding what approach to take for your computational problem in general, check out the flowchart on the Awesome Godot Scientific page.

NumDot

This library: A NumPy-like tensor math library made for Godot.

Pro

  • Good integration in the Godot ecosystem.

  • Does not require any additional language beyond gdscript (or C#).

  • Easy to install (through the asset library).

  • Accessible documentation.

  • Developed for games, with according priorities.

  • Ability to optimize for binary size vs performance.

  • (Ability to run operations in-place on godot types, WIP).

Con

  • No ecosystem, small userbase.

  • Young library with many uncertainties.

  • Important parts of NumPy not yet covered.

NumPy

NumPy is the most popular tensor math solution. If using the most mature ecosystem is your biggest concern, this is your best option.

Pro

  • Largest Ecosystem of all solutions.

  • Very Mature.

  • Large existing userbase.

  • Ability to prepare code in ipython notebooks.

Con

  • Requires another language as gdextension (python), increasing complexity.

  • Requires the full python interpreter, and the large NumPy binary (100+mb).

  • No interoperability with Godot types.

Note: You may want to consider TensorFlow for extreme projects, which can run on the GPU. Getting it to run can be difficult though.

xtensor

xtensor is a numpy-like library made for C++ developers. NumDot uses xtensor under the hood. If you want to use xtensor, consider forking or extending NumDot instead, using a custom build.

Pro

  • Extremely Fast, SIMD accelerated.

  • Good coverage of NumPy API.

  • Header only, i.e. very small binary size.

Con

  • Requires another language as gdextension (C++), increasing complexity.

  • Requires using a low level language (C++), which can be difficult.

  • Fairly small ecosystem.

  • No interoperability with Godot types.

NumSharp

NumSharp is a NumPy port for the C# ecosystem. If you are mainly using C#, and want a more general option than NumDot, this is a good contender.

Pro

  • Well integrated in the C# ecosystem.

  • No gdextension needed.

  • Reasonable binary size (~20mb).

  • Good coverage of NumPy API.

Con

  • Cannot use this API from gdscript.

  • No built-in interoperability with Godot types.

  • Some performance features missing (though it may be fast enough for your needs):

    • No in-place operations, slowing down repeated computation due to repeated allocation.

    • No SIMD acceleration, implementation is native C#.

  • Fairly small ecosystem.

  • No online documentation (granted it's very close to the NumPy API).

  • No way to reduce binary size.


User-contributed notes

Please read the User-contributed notes policy before submitting a comment.