-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rebuilding the module is slow #24
Comments
Box2D should work as a shared library, I have used it fine dynamically in other projects so I'm not sure why they would claim otherwise? I dunno, maybe something has changed. In general, build time is something that's also being worked on as well by a few godot devs (there's a side effort to port scons to meson). But most of my build time is scons scanning dependencies. I have tried https://docs.godotengine.org/en/latest/development/cpp/custom_modules_in_cpp.html#improving-the-build-system-for-development to just build a module as a shared library, but eventually gave up and just included it statically in the engine. My build time for a module change is about 10s, which is slightly underneath my own threshhold to optimize further. But ya i hear ya. |
also make sure to pass "-j", "X" to scons, cause i dont think scons picks up cpu core's automatically |
Yeah, compiling statically is known to be slow (especially on Windows at parse-time due to Python I/O slowness), but I wouldn't say it's that slow to my taste (I take more time to think about my algorithm's correctness before I decide to compile, and I use VSCode C++ features that report problems beforehand). Otherwise, there's GDNative approach to use Box2D as a dynamic library, but now you'll have to think about writing your own build scripts and deal with initialization steps like setting up GDNative library in the editor. Pick your own poison, as they say. This is why I prefer to use C++ modules because they are much easier to maintain, slow compilation times are quite negligible in comparison. Also, if you ever plan to integrate Box2D as a physics backend, then I don't think it's possible to use GDNative to achieve this.
This is because SCons's main principle is correctness rather than performance. I rarely see a build borked by SCons, and I like the flexibility of it because everything is Python. 🙂 |
Using VS 2019 on Windows 10.
Right now, making changes and rebuilding to test takes just enough time to be annoying.
It might be possible to speed this process up following documentation here: https://docs.godotengine.org/en/latest/development/cpp/custom_modules_in_cpp.html#improving-the-build-system-for-development
Box2D claims to not work as a shared library, but I don't know why. We build Box2D with SCons as part of this module so maybe it will be fine.
The text was updated successfully, but these errors were encountered: