this post was submitted on 19 Oct 2024
1 points (100.0% liked)

Godot: The open source game engine

21 readers
1 users here now

A community for discussion and support in development with the Godot game engine.

founded 1 year ago
MODERATORS
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/zeetu on 2024-10-18 16:55:18+00:00.


This post a few days ago about C++ vs GDScript inspired me to create a more realistic benchmark:

That benchmark did a prime number search which is all well and good but games don't really do that.

My benchmark:

The benchmark simulates two common operations in a grid-based inventory system:

  • Finding an available space for a 2x2 item in a 10x10 grid inventory.
  • Sorting the inventory by moving all items to the top-left corner in order.

These are common in games and do a better job of highlighting the difference between C# and GDScript.

All the code and results are on GitHub if you want to play with it.

TLDR is that C# is faster but it doesn't matter. Games rarely do thousands of iterations on an inventory and a player won't notice the difference between C# and GD. The sort of the inventory for example: GDScript time: 0.000075 seconds C# time: 0.000014

In the off chance you do need the speed you can easily port the expensive operation to C# or C++

no comments (yet)
sorted by: hot top controversial new old
there doesn't seem to be anything here