godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
89.43k stars 20.25k forks source link

GDNative very slow in master #20412

Closed lupoDharkael closed 6 years ago

lupoDharkael commented 6 years ago

Godot version: slow version: master https://github.com/godotengine/godot/commit/4b549faaab40f09756b644d4ad4d9d63e3b5e70c working ok: Godot_v3.0.5-stable_x11

OS/device including version:

Fedora 28: Linux 4.17.7-200.fc28.x86_64 Mesa 18.0.5 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller Kernel driver in use: i915 VGA compatible controller: NVIDIA Corporation GF117M [GeForce 610M/710M/810M/820M / GT 620M/625M/630M/720M] (rev a1) Subsystem: Acer Incorporated [ALI] GeForce 710M Kernel driver in use: nouveau

Issue description: My project uses GDN (C++ bindings) for procedural map generation, I compiled the commit indicated before from master to test the optional typing with gds but I noticed an important slowdown in the generation of the map.

I have a method to disable the collision generation because the generation concave collisions takes a while and sometimes I just want to see how the map was generated. Here some benchmark info:

3.0.5 without collisions: around 600ms with collisions: between 1000ms and 2000ms

master without collisions: around 1600ms with collisions: between 7000ms and 10 000 ms

I was using cpp-bindings a few months old but after updating to the version in master of the bingings the results are the same in godot master and 3.0.5

Steps to reproduce: I can send my project to a core dev so it can be tested but I don't have a minimal reproduction project. I just need to run my generation to appreciate a very slow generation of the map, after the generation everything works at 60fps and without lag so the rest of the engine seems to be working ok.

akien-mga commented 6 years ago

To compare official builds like Godot_v3.0.5-stable_x11.64 and self-compiled builds, you need to make sure to build with the same options as the official binaries.

What compilation option are you using? The official editor binary for Linux is built with: scons p=x11 CC=gcc-8 CXX=g++-8 tools=yes target=release_debug use_static_cpp=yes use_lto=yes debug_symbols=no

lupoDharkael commented 6 years ago

After compiling with those flags it works perfectly. Is that information of the flags in the docs? I think it only mentions scons p=x11 and the alternative of using lvm

vnen commented 6 years ago

For reference: http://docs.godotengine.org/en/3.0/development/compiling/introduction_to_the_buildsystem.html

akien-mga commented 6 years ago

I have on the back of my mind to write a docs page about building binaries like the official ones, but it's sitting comfy on the TODO list for now ;)