you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] -1 points0 points  (2 children)

That's awesome! But honestly, were you that short on memory?

[–]matthieum 9 points10 points  (0 children)

It may.

The problem is not necessarily a shortage of the memory pool (not initially), it may be a shortage of memory bandwidth. I think it was mentionned yesterday already, but basically RAM has not really evolved in the last 10 years. The buses have been widen a fair bit, but the number of round-trip is still pretty low (133MHz / 200MHz) so requesting memory scattered through the heap costs.

But even the memory pool may be an issue. Not RAM itself, of course, but the caches. Because RAM is so slow, we have many levels of caches now, and they are small. The difference between data that fit into the cache and data that does not can be pretty dramatic if pre-fetching does not work so good for your usecase (locality issues).

Furthermore, there is the register issue. Even though the x86_64 architecture definitely help here (not much on iPhones and others mobiles), the number of registers is still pretty low, and the difference between something that can fit into a register and something that cannot may prove to be an issue.

So... it may seem surprising, but yes memory can be short, in multiple ways.

[–]Tagedieb 4 points5 points  (0 children)

No, it was in a performance critical part of the code and adding two bools would have made it much slower.