Performance
Post #7980 · source on Telegram
Batman Slaps Robin: C++ Speedup Matters at Billions of Runs
Description
Classic Batman-slapping-Robin comic panel meme (imgflip watermark) on a red background. Robin's speech bubble says 'YOUR 3000 LINES CPP IS JUST 0.001 FASTER THAN MY 10 LINE PYTHON', and Batman, mid-slap, replies 'TRY RUNNING IT A FEW HUNDRED BILLION TIMES.' The meme distills the perennial Python-vs-C++ performance argument: per-invocation differences look negligible in microbenchmarks, but at hot-path scale - billions of executions - small constant factors compound into massive compute and cost differences, justifying the verbosity of systems languages
Use J and K for navigation
Comments
68Comment deleted
At one run it's premature optimization; at a few hundred billion runs it's the difference between a t3.micro and a datacenter line item with its own VP
A millisecond is negligible until 10¹¹ calls turn it into 3.17 CPU-years.
It absolutely depends on the situation if what matters the most is the extra performance or the time to production Comment deleted
Fuck ttp Comment deleted
Fuck ttp My homies never ship Comment deleted
You look like a .Net master indeed... Comment deleted
Im your slave bro Comment deleted
performance is for the users. time to production is for the shareholders. Comment deleted
ok I guess to some extent ttp is for the users too. my point with this was to say that in our short-term-profit-driven world we often seem to be optimizing for ttp and hype at the expense of all else. Comment deleted
in other words: ttp is well and good, and yes a feature shouldn't take forever to land, but we should also make sure to take enough time to do it right. Comment deleted
Claude, you are a senior developer. One shot this feature Comment deleted
No mistakes Comment deleted
Not only users or stakeholders, ttp is for the business. Time to production have been sometimes a big market competitiveness factor, with major examples as YouTube / Google Video Comment deleted
I'm sure users won't care when there is a runtime bug in the 3000 lines Comment deleted
C/c++ is the reason for 99% of all CVEs. The people are a reason but try giving AK to a chimpanzee Comment deleted
Wow, the language that has been used for the majority of performance oriented security critical code for the past 40 years is the reason for most of the CVEs, what would be the reason for that Comment deleted
Any other compiled language, like idk pascal, would have 99-100% of performance and removed 80% of cves because it just doesn't allow everything c allows Comment deleted
Well, most of the important stuff from the past half century is written in C/C++. We'll never know if Pascal would have been better in this regard because it's not as wide spread, but I suspect that it wouldn't be any different. Comment deleted
It has much stricter syntax and automatic array ranges checking, it had this even in old compilers from 80s. That would solved like 90% of problems Comment deleted
Rust has much stricter compiler rules. There is still 113 vulns in the uutils coreutils Comment deleted
People will write vulns in any language they are given Comment deleted
Thats true, especially those people who tend to see themselves as superior to others and stop questioning their own actions, like rust programmers....wait...oh shit😁 Comment deleted
I just think that the fact that most of the critical software we use today is written in C/C++ is the main reason there are so many CVEs for it, not the fact that it's inheritely unsafe Comment deleted
I think the creators of all the major OSs, all the major DBs, Browsers and so on knew what they were doing when picking a language to use Comment deleted
1000 billion shit eating flies are right, right? Comment deleted
I have people I look up to, yes. That is called having a direction to move towards. And I think people who created widely used performant systems like Linux, GNU utils, OpenSSH, Postgre, OpenSSl, V8, SQLite, MacOS, Chrome, Firefox, are a good north star. Comment deleted
It's just a coincidence, c was there in the right place at the right time, and so everyone went with it. Comment deleted
Pascal was created 2 years before C Comment deleted
But it wasn't in the right place Comment deleted
You were literally talking about the arrogance of rust Devs in the previous message, the irony of this is oh so delicious Comment deleted
I hate C++ but I do agree Comment deleted
borderline ragebait Comment deleted
Nothing borderline about this Comment deleted
The "just use Linux" types for the last 10+ years Comment deleted
Well, latest windows developments make ir more and more true😐 Comment deleted
Fair but it didn't make as much sense when Windows 7 was popular Comment deleted
Yes. And Linux desktop is the same headache as always, especially if something unconventional is needed, then its back to "./configure" baby. Maybe steam take is a little better, didn't tried Comment deleted
I'd rather just use whatever OS I want. The amount of people with the "just use Linux" line makes me never want to use it Comment deleted
Don't listen to people they are stupid mostly. Comment deleted
Lol, reminds me of the "just use this game engine" types. I found it easier to make my own engine in C but kept getting those types commenting when I'd run into issues, along with the "just use Linux types" Comment deleted
Although now it's an irony because I use Godot atm for game dev but it's so much easier when you know the limitations and workarounds in your own engine, since you can just add whatever features you want Comment deleted
I'm also doing this in Android for Android devices, for added difficulty and convenience (you can have a phone everywhere where laptops and PCs usually stay put) Comment deleted
I use arch btw Comment deleted
Although that's almost their solution to everything. Having problems with Android? Install Linux. Having problems with Apple? Install Linux Comment deleted
If you're having problems with a specific game, install Linux, even if the game is unavailable for Linux Comment deleted
Or my favorite, if you use FL studio and people say to switch to Linux, even though LMMS is pretty bad Comment deleted
Stupid people Comment deleted
#unsafe detected lol Comment deleted
you could've just read the actual list of cves, it's straight up embarrasing and none of it is related to unsafe or any of that bs almost all of it may have happened in any other language where users refuse to think with their brains, and decide that some mechanical god will protect them from all the curses https://seclists.org/oss-sec/2026/q2/332 Comment deleted
Lol Comment deleted
Hmm I wonder what's safer: c/c++ code that has been battle tested for decades or a rewrite in rust few months old Comment deleted
At what cost? Software-based range checking has its own performance overhead. Hardware-enforced memory protection is cool, but hard (next to impossible) to use in general-purpose software with large codebase. Comment deleted
There are probably something like 0.5% of the code where software range checking really made it slower for the entire app. So write these hot spots without checking, and leave it on for everything else. So ok, some hi load server will have 90% of the current performance because of that, big deal. Comment deleted
If you have a server that is 10% slower on average, your P99 baloons, given most modern websites require multiple calls to a server per action, the situation becomes even worse Comment deleted
Well, just add some more cores and memory and servers Comment deleted
JS dev ahh take Comment deleted
That's how .Net works, afair: it disables range checking inside sequential loops, checking just the lower and upper bounds. But still, according to my rough estimations, .Net performs ≈10x slower than C/C++ on a "computational" code (not necessarily floating-point math, but cryptography or big integer arithmetics) — where the CPU is the bottleneck, not the I/O. Comment deleted
10x slower? I would like the example or the link for that that sounds insane. Or maybe you're talking about a first run of the code? Before JIT kicks is [yo] Comment deleted
No, the code being repeated enough for a relevant comparative benchmarking. The numbers I remember for a Blowfish cipher implementation were, like, 2500 vs 28000 key probes per second on a single Core i7-2600 core — just enough to use .Net for brute-forcing 10000 possible keys, but definitely leaning towards C for brute-forcing 2⁴⁰ combinations. I don't remember the exact number for big integer math (for DSA signatures), but the ratio was similar — an order of magnitude, at least for the time of those experiments 10 years ago, when .Net 4.5 was the most recent version (of the classic .Net, not the rebooted one). Comment deleted
Thats crazy, that it was so bad Comment deleted
No-fun-allowed zone Comment deleted
They forgot to mention that it’s the same instructions running on the cpu Comment deleted
Just use assembly Comment deleted
sybassss Comment deleted
10 lines of the python in question: from something_written_on_c import read, loop1, loop2, loop3, write if __name__ == '__main__': a = read() b = loop1(a) c = loop2(b) d = loop3(c) write(d) Comment deleted
Every single time Comment deleted
so switching languages will magically solve everything, right? right...? https://www.cvedetails.com/vulnerability-list/vendor_id-39558/product_id-190816/Uutils-Coreutils.html https://discourse.ubuntu.com/t/an-update-on-rust-coreutils/80773 Comment deleted
I use void btw Comment deleted