3 ms·
php is not unique in having big memory footprint. AFAIC Python and Ruby are also memory hogs. An interesting question is how memory efficient a dynamic PL can b
by lang 15y ago
php is not unique in having big memory footprint. AFAIC Python and Ruby are also memory hogs. An interesting question is how memory efficient a dynamic PL can be. Given that in modern computers memory access (cache misses) is fairly expensive it probably makes sense to trade instructions for memory.
- masklinn 15y ago> AFAIC Python and Ruby are also memory hogs. Even more so in some areas, for instance a Python `int` is not a machine integer but a full-blown object.
- lvh 15y agoIt's only always a full-blown object in CPython. Smarter implementations, notably PyPy, will do escape analysis, and never actually end up allocating those objects. (My point is that not having unboxed types does not imply being a memory hog. You just need a smarter implementation.)
- masklinn 15y ago> Smarter implementations, notably PyPy, will do escape analysis, and never actually end up allocating those objects. Objects in a collection (which is what we're talking about here) escape kind-of by default. Until type-specialized collections are merged in PyPy (if they are not yet), it'll have the same issue as CPython.