GothicKit / ZenKit

A re-implementation of file formats used by the early 2000's ZenGin

Home Page:http://zk.gothickit.dev/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Reconsider usage of `unordered_set/map`

Try opened this issue · comments

commented

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

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.

commented

RelWithDebInfo

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

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)?

commented

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

In principle can prepare PR somewhat later