Using memory efficiently can give you a 10-100x win.
Yes, it can. But why is this exclusive to assembly? What are you planning to do with your memory use in assembly that is not achievable in C++ or other languages? Memory optimizations are largely about data structures and access patterns. This is available to you in C++.
Also, if you don’t want 90% of the craziness of C++ then why not just code in C++ without 90% of the craziness? As far as I know what’s what a lot of performance-critical projects do. They operate with a feature whitelist/blacklist. Don’t tell me you have the discipline to work entirely in assembly and the knowledge to beat the compiler at the low level stuff that is not available to you in C++ but you can’t manage avoiding the costly abstractions.
I think it speaks volumes how rarely you hear about programs being programmed in assembly. It’s always this one game and never any meaningful way to prove that it would gain performance by not being written in C++ when using a modern compiler.
Yes, this is normal and it’s a good thing (unless you’ve come across a bug). I don’t know exactly what app the screenshot is showing, but I’m guessing that the caching shown is referring to the filesystem cache. The kernel is keeping a cache of files you are likely to access again so that it doesn’t have to read them from storage again. So what you’re seeing here is that some memory contents were moved to swap to make room for filesystem cache. This is because the kernel believes you’re more likely to access those files again rather than the memory contents. If it’s right, then this a performance improvement despite the fear surrounding swap usage.
Setting a low non-zero swappiness value is telling the kernel that memory contents have priority over filesystem cache for remaining in RAM, or conversely that file cache is more likely to be evicted from the RAM. A value of 100 would mean that they have equal priority. So that memory content must have been very stale to be evicted despite having a significantly higher priority to reside in RAM.
So:
Source: https://chrisdown.name/2018/01/02/in-defence-of-swap.html