88
votes
Accepted
When is the best time to consider performance?
Engineering for Performance
Follow vendor recommendations.
Use the correct data structures.
Implement the correct usage patterns.
Don't do anything stupid.
Optimization
When already written code is ...
22
votes
When is the best time to consider performance?
If you want to do optimization at the right times, have slow machines and use them. For a small shop, a good option is to use a slow laptop on the commute and a fast desktop in the office. As an ...
9
votes
When is the best time to consider performance?
No, you don't have to check after every line because not every line is performance-relevant. It mostly depends on how often a line is executed. A code section which takes 1 ms to be executed is ...
3
votes
When is the best time to consider performance?
You need to put in enough effort to at least go "is this potentially going to be a bottleneck, and if so, how involved a change will it be to fix it?".
Generally speaking, this involves a balance ...
3
votes
Accepted
How to reference nameof private serialized field in unity custom inspector
Use your interface
Handily enough, you already have your answer. Leave the speed field public, but never pass around or declare references to that class. Only ever ...
2
votes
Accepted
How to manage instances of (placed) cards and decks in card games?
There is never one "right" or "wrong" way to do something in programming. Just ways which do or do not work for you, your team and your project. So don't worry about doing things the right way, worry ...
2
votes
OpenGL glVertexAttribFormat vs glVertexAttribPointer
Strides cannot be zero.
Try:
int strides[] = { (int)sizeof(vec3), (int)sizeof(vec3)};
glBindVertexBuffers(0, 2, ptrs, offsets, strides); //comment
Otherwise, ...
1
vote
Right way to get reference from across scene object in unity
If this object belongs to a scene, I would consider the scene an object in and of it self. In other words, I would have a top level object with a SceneXManager, with references and/logic for the ...
1
vote
When is the best time to consider performance?
For a game, your primary goal is to meet the target framerate on the target minimum spec machine (and possibly a maximum load time, etc).
In order to do that, no, you do not have to worry after every ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
refactoring × 14unity × 6
c# × 5
software-engineering × 2
optimization × 2
c++ × 1
opengl × 1
2d × 1
java × 1
collision-detection × 1
mathematics × 1
game-design × 1
architecture × 1
rpg × 1
design-patterns × 1
component-based × 1
ui-design × 1
state × 1
editors × 1
serialization × 1
instancing × 1
vertex-buffer × 1
inheritance × 1
inventory × 1
monobehaviour × 1