GothicKit / ZenKit

A re-implementation of file formats used by the early 2000's ZenGin
http://zk.gothickit.dev/
MIT License
44 stars 9 forks source link

Reconsider usage of `unordered_set/map` #71

Closed Try closed 12 months ago

Try commented 1 year ago

While profiling with debug build, notice, that mingw spends too much time in deallocation of memory and maps in particular.

Tested locally: changing std::unordered_set<std::uint32_t> bsp_tree:leaf_polygons; to sorted array std::vector<std::uint32_t> gives about 3x boost to load-time. From 110022ms to 36418ms

lmichaelis commented 1 year ago

Hm I'll look into it. phoenix itself takes about 4 seconds to load a world in debug mode though so the 7 remaining seconds are just OpenGothic's conversion stuffs. I'd recommend running in release mode with debug symbols (RelWithDebInfo in CMake) anyways. With that load times are >200 ms.

Try commented 1 year ago

RelWithDebInfo

No, it's horrible way of debugging anything - lack of glsl debugging is bad enough already)

lmichaelis commented 1 year ago

Okay, just to make this reproducible for me, which version of MinGW-w64 are you using and did you add any additional compile flags to the build different from the default (that includes flags added by your build tool, e.g. VisualStudio)?

Try commented 1 year ago

MinGW 11.2.0 64-bit for C++ (installed with Qt-sdk) CMake generator: Ninja

In principle can prepare PR somewhat later