Benchmark Godot & Rust

Stephan D.
2 min readNov 7, 2020

I recently started looking into using Rust and the Godot Game Engine for developing games. A very quick experiment recently was to compare performance of GDScript, Visual scripting and Rust for the same task.

The Contest

It is simple: Let us just draw a ton of lines to have a lot of traffic between our code and the engine:

In fact it is so many lines that we end up with a filled circle. Nothing beautiful, this is just a benchmark afterall 👌

Let us look at the contenders:

GDScript is the official scripting language shipping with Godot.

Visual Script is the official node based way to visually script in Godot (think Unreal Blueprint or Unity Bolt)

GDNative is the official C-Api to access Godot from escentially any language. We are using Godot-Rust to be able to compile shared libraries from Rust code to interface with Godot.

The entire test with all three options can be found on github: extrawurst/godot-rust-benchmark

Rerun it for yourself :)

GDScript

Let’s start with the official way of doing things in Godot — using GDScript:

Visual Script

The following screenshot shows the same logic in a visual node based way:

We immediately see how this is more verbose but at least it is possible and it even just crashed once on me 🙈

GDNative (Rust)

We are using Godot-Rust for this:

I am not going to further comment on the ergonomics of either language. I really did this for two reasons: 1) can we do all we need in the visual script and 2) how does performance compare between the alternatives

Here are the timings:

(executed on a macbook 2016 3,3 GHz i7, 16 GB Ram, Intel Iris 550 and Godot 3.2.3)

On twitter people noted that this might change with Godot 4.0 and the support of type checking in gdscript. This could be interesting to measure once 4.0 is released.

For now my conclusion is:

  • GDScript is easy and quick to learn
  • Visual Scripting in Godot works although it feels a little instable
  • Godot-Rust is a clear alternative to write entire Godot games in

Of course point 3) is limited to people coming with a Rust background otherwise the Rust part in it is a clear challenge to learn first.

Originally published at https://blog.extrawurst.org on November 7, 2020.

--

--

Stephan D.

Founder of gameroasters and @liveask1 , #indie #gamedev, #rust enthusiast, worked previously at @innogames , @ubisoft