How much faster are register based architectures than stack architectures?
- by drozzy
Studying compilers course, I am left wondering why use registers at all.
It is often the case that the caller or callee must save the register value and then restore it.
In a way they always end up using the stack anyway. Is creating additional complexity by using registers really worth it?
Excuse my ignorance.
Update: Please, I know that registers are faster than RAM and other types of cache. My main concern is that one has to "save" the value that is in the register and the "restore" it to. In both cases we are accessing some kind of cache. Would it not be better to use cache in the first place?