November 18, 2022

Panic fear is a bad guide

Panic fear is a bad guide

How can Intel sell more CPUs? It can't if software runs well. It can if software slows down. How can software slow down? If underlying libraries slow it down, it can. Let's see how they achieve this.

What OS is installed on most of computers? Windows. Who makes Windows? Microsoft. Every new OS of theirs is slower than the previous. A-ha! We are onto something.

What else does MS make? Right! .NET framework/core. This is what the bulk of software uses for its library layer. WPF is slower than WinForms. GDI+ is slower than its predecessor GDI. Yada-yada-yada. We found Intel's accomplice!

Let's see where MS makes the greatest push against performance. A-ha, it is in async/await. They managed to scare most of developers into panic fear of threads. Their emissaries on Stack Exchange, Github, SourceForge, and thousands other online resources kept hammering developers with their mantra: Do not use threads! Threads are evil! They will screw you over and byte you in the ass! Fear threads! Use async/await that runs on the same thread but magically asynchronously. What is wrong with this?

Such paradigm improves performance if and only if the application spends most of its time idling. Then splitting work into before and after await can free up resources of the main thread during spikes of activity. But turn your effin' brains on! If you strive to do 100% of the work on the same thread, then why the hell do you have multi-core CPUs? For the OS to do its own payload on the rest of cores? Why? Is MS mining crypto-currencies on them and lying to us about CPU load (which it actually does, but later about that)?

In George Carlin's voice: 'Are you fucking stupid?' You are being corralled into a pen with this doctrine! Your's truly runs threads, and his apps' performance is mind-blowing compared with crawl speed of async software. Reason is simple and straightforward: when 1 CPU is busy, another can pick up the load. It is as simple as 1-2-3. Nothing in software development is magical, nothing comes free, and there is always technical explanation to technical constraints. The expectation that async can magically accelerate software w/o dividing load among CPUs by way of threads comes from the domain of fiction. Live with this!

Posted by: LinuxLies at 09:46 AM | No Comments | Add Comment
Post contains 395 words, total size 2 kb.




What colour is a green orange?




15kb generated in CPU 0.0173, elapsed 0.0627 seconds.
35 queries taking 0.0576 seconds, 127 records returned.
Powered by Minx 1.1.6c-pink.