Tag Info

Hot answers tagged

8

The real implications in performance here depend 100% on the platform used. Say you have written code as in option 2. When using a statically compiled language such as C++ the compiler will presumable not notice that container.left + offset.x is constant for as long as the object lives and it will not optimize it. When using a language that uses ...


5

tl;dr You control how much data you are willing to process each frame. If a packet is too big, break it into smaller cells and process them one at a time (i.e one each frame). If you get a lot of small packets than split the group into chunks and limit the amount of information processing that is done each frame. The client does not need all the information; ...


4

Basically, there will be a mapping from graphics performance level setting (low/medium/high/et cetera) to particular values of a variety of internal knobs and dials in the underlying graphics engine. It can affect almost anything: texture sizes, maximum LOD level, multisample passes, toggling entire features (such as reflection) that often require extensive ...


4

First, I wouldn't say that in this case you are optimising too early, depending on your use case. In any case though, you've asked an interesting question and as I have experience with this myself, I'll weigh in. I'll try to just explain how I ended up doing things and what I found on the way. Each entity holds a vector of generic component handles which ...


3

In my experience with android, it is the garbage collection the kills the performance, not the allocation, although these two are tied hand and hand. As mentioned on the comments, pre-allocation is a way to deal with this issue. This is known as a memory pools. Another similar solution is object pool pattern. An object pool allocates as needed, but does ...


2

To answer just this: My question is, since I am not iterating linearly one contiguous array at a time in these cases, am I immediately sacrificing the performance gains from allocating components this way? Is it a problem when I iterate, in C++, two different contiguous arrays and use data from both at each cycle? No (at least not necessarily). ...


2

Short Answer: Profile then optimize. Long Answer: But, when I am to iterate component arrays to do something with them from a system on an actual gameplay implementation, I notice that I almost always am working with two or more component types at once. Is it a problem when I iterate, in C++, two different contiguous arrays and use data from ...


2

The only way to know for sure is to try both ways, as they can both be faster than each other in different circumstances. The first can be faster because less computation is done, the second can be faster because data is smaller which normally helps avoid costly cache misses. It depends totally on the context. Put another way, I could construct one benchmark ...


1

To answer your question simply: Get list of all the RenderComponents, and a list of all the Movement Components. We assume each component has a field which gives the entity is is a part of. Sort them by entity ID. Obviously, if you keep these lists sorted in the systems themselves, then this is very inexpensive (maintaining the sorting is cheap). ...


1

You could store components two-dimensionally in a list of lists: List<List<PslComponent>> _componentsByType; You use the component type ID as the index into the outer list... List<PslComponent> componentByEntity = _componentsByType[componentTypeId]; ...and then use the entity ID to look up the component of that type on that entity (or ...


1

I assume that when your network data arrives, its processing diverts enough CPU power to slow down your rendering process. Are you enforcing a constant framerate or are you just rendering frames as fast as you can? Assuming you have a constant framerate, you may chose when your network packets are processed. I mean by that that your websocket event should ...



Only top voted, non community-wiki answers of a minimum length are eligible