godotengine / godot

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

Get rid of huge functions #12419

Closed leonkrause closed 4 years ago

leonkrause commented 7 years ago

Godot has at least 2 functions that are very big when compiled:

This increases the size of our binaries, so we should see what we can do about these. The code base should also be checked for more huge functions.

akien-mga commented 7 years ago

Both are from thirdparty components, we should try to get changes done upstream in priority (we can patch our copies in parallel as long as we keep track of changes with actual patch files):

ghost commented 7 years ago

Have you tried optimizing for size with -Os and replacing force-inlines with ordinary inline?

At least this is what I'd do as a first step if binary size is a concern for some reason.

leonkrause commented 7 years ago

This is about dealing with single overly large functions. -Os affects the whole code base, that's not the goal here (though we should evaluate usage of -Os or -Oz for HTML5 builds).

ghost commented 7 years ago

I don't understand how size can be concern for certain functions while not for others

ghost commented 7 years ago

-Os can be specified for per-file BTW (by overriding optimization option) after isolate those functions in a file, it doesn't have to affect the whole code base

Calinou commented 7 years ago

Should we keep hq2x_resize, since we have a vector-based theme now? (Games still use the old image-based theme, but hiDPI isn't used there by default.)

ghost commented 7 years ago

https://en.wikipedia.org/wiki/Hqx

This is very important to the engine isn't it? Especially for pixel games?

akien-mga commented 4 years ago

Closing as HQ2X was removed, and for PCRE2, I'm not sure what we could do.