Skip to main content
deleted 4 characters in body
Source Link
Tulains Córdova
  • 39.6k
  • 13
  • 102
  • 157

I'm currently at the design stage of a component-based architecture in c++C++.

My current design includes the usage of features such as:

  • std::vectors of std::shared_ptrs to hold the components
  • std::dynamic_pointer_cast
  • std::unordered_map<std::string,[yada]>

Components will represent data and logic of various items that are needed in a game-like software, such as Graphics, Physics, AI, Audio, etc.

I've read all over the place that cache misses are hard on performance, so I ran some tests, which led me to believe that, indeed, it can slow down an application.

I haven't been able to test the aforementioned language features, but it is said atin many places that these tend to cost a lot and should be avoided if possible.

Since I'm at the design stage of the architecture, and that these will be included in the core of the design, should I try to find ways to avoid them now, since it's going to be very hard to change it later if there are performance issues?

Or I'm just caught in doing premature optimization?

I'm currently at the design stage of a component-based architecture in c++.

My current design includes the usage of features such as

  • std::vectors of std::shared_ptrs to hold the components
  • std::dynamic_pointer_cast
  • std::unordered_map<std::string,[yada]>

Components will represent data and logic of various items that are needed in a game-like software, such as Graphics, Physics, AI, Audio, etc.

I've read all over the place that cache misses are hard on performance, so I ran some tests, which led me to believe that, indeed, it can slow down an application.

I haven't been able to test the aforementioned language features, but it is said at many places that these tend to cost a lot and should be avoided if possible.

Since I'm at the design stage of the architecture, and that these will be included in the core of the design, should I try to find ways to avoid them now, since it's going to be very hard to change it later if there are performance issues?

Or I'm just caught in doing premature optimization?

I'm currently at the design stage of a component-based architecture in C++.

My current design includes the usage of features such as:

  • std::vectors of std::shared_ptrs to hold the components
  • std::dynamic_pointer_cast
  • std::unordered_map<std::string,[yada]>

Components will represent data and logic of various items that are needed in a game-like software, such as Graphics, Physics, AI, Audio, etc.

I've read all over the place that cache misses are hard on performance, so I ran some tests, which led me to believe that, indeed, it can slow down an application.

I haven't been able to test the aforementioned language features, but it is said in many places that these tend to cost a lot and should be avoided if possible.

Since I'm at the design stage of the architecture, and these will be included in the core of the design, should I try to find ways to avoid them now, since it's going to be very hard to change it later if there are performance issues?

Or I'm just caught in doing premature optimization?

Tweeted twitter.com/StackProgrammer/status/758365618391449600
Source Link

Am I prematurely optimizing?

I'm currently at the design stage of a component-based architecture in c++.

My current design includes the usage of features such as

  • std::vectors of std::shared_ptrs to hold the components
  • std::dynamic_pointer_cast
  • std::unordered_map<std::string,[yada]>

Components will represent data and logic of various items that are needed in a game-like software, such as Graphics, Physics, AI, Audio, etc.

I've read all over the place that cache misses are hard on performance, so I ran some tests, which led me to believe that, indeed, it can slow down an application.

I haven't been able to test the aforementioned language features, but it is said at many places that these tend to cost a lot and should be avoided if possible.

Since I'm at the design stage of the architecture, and that these will be included in the core of the design, should I try to find ways to avoid them now, since it's going to be very hard to change it later if there are performance issues?

Or I'm just caught in doing premature optimization?