Re:How big are PHP arrays (and values) really?
by lvh on Friday December 16, 2011 @05:19AM
(#3360246)
It'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.)
Re:How big are PHP arrays (and values) really?
by masklinn on Friday December 16, 2011 @06:25AM
(#3360376)
> 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.
Even more so in some areas, for instance a Python `int` is not a machine integer but a full-blown object.