CatDogEngine icon indicating copy to clipboard operation
CatDogEngine copied to clipboard

Codes/Performance/Memory Improvement

Open T-rvw opened this issue 2 years ago • 0 comments
trafficstars

To improve coding details:

  • define FORCEINLINE macro explicitly to force some methods to compile as inline.
  • force all string hash to be executed in the compile time.
    • Only init logics will use runtime hash now.
  • std::move -> MoveTemp similar to UE so that we can get static_assert if the parameter is a const or already rvalue.
    • Engine side needs to replace. But it will include many header files?

To adopt modern cpp features:

  • C++ 20 std::span helps to reduce code size

To add basic infrastructure:

  • add allocator classes to improve memory layout.
    • std::unique_ptr needs to write a customized deleter class for it to free memory by ourselves
  • JobSystem to support multiple threads
  • SIMD Math

T-rvw avatar Dec 05 '22 05:12 T-rvw