Open Witek902 opened 9 years ago
Last 2 points of the First Steps pique my interest - why stop using std::string, when we provide stl allocators? Is it because of all unused features, that the std::string gives over char arrays?
@mkulagowski No, it's because performance. std::string uses memory allocation, which we should avoid. For example, at https://github.com/nfprojects/nfengine/blob/devel/nfEngine/nfCore/Mesh.cpp#L107 we could use simple C-string to concatenate the path (the string would be keeped on a stack). In unit tests we can use normal std::string, because we don't care performance much there.
Currently, all memory allocations are done via malloc/new. This is OK in some cases (unit tests), but using it for managing objects which are frequently created and deleted have flaws:
TODO checklist:
Write test cases and performance test of e.g. entities creation and deletion. Compare the performance after moving to the new allocators.