lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


>From page 23 of Lua Programming Gems: "For a polyline with one million
points, this change reduces the use of memory from 95 KBytes to 65
KBytes ... With this representation, a one-million-point polyline uses
only 24 KBytes of memory."
These numbers appear to be out by many orders of magnitude; one
million points (10^6, each having x and y) in 95 KBytes (~10^5 bytes)
is impossible, and the same number of points in ~24*10^3 bytes is even
more impossible. I can't help but feel that collectgarbage("count")
was used to get these numbers, and the result was interpreted as the
number of bytes rather than the number of kilobytes. If this were the
case, then the true numbers would be 95 MBytes, 65 MBytes and 24
MBytes respectively, which seem much more likely numbers.