Now, we’re accustomed to hearing about “this is small and doesn’t introduce any noticeable difference”, especially from the explanations from AI.
Like the other day, while conversing about the decision on whether or not I should pass the struct to a semaphore channel before spawning the goroutine or inside the goroutine, I was told that “this code is extremely lightweight either way and it'll spawn ~2KB for each goroutine, so for 1000 topics, only ~2MB or RAM would be used, which is negligible”.
I initially overlooked it but later on I thought: if I could save 2MB now why shouldn’t I?
Later I thought that this “tolerance” is now overlooked due to the availability in storage capacity of modern computers. And more often than not, modern engineers, upon dissecting the code and work of engineers of the old days would see highly optimized code due to them spending much of their time optimizing, naturally, due to the limit of resources.
2MB of RAM today is nothing, but 20 years ago it would be the difference between a laggy experience or a smooth one.