From: Mathieu Bouchard Date: 2005-05-03T22:26:35+09:00 Subject: Re: collections with values of fixed classes/lengths ---1077017559-1521213240-1115126775=:9488 Content-Type: MULTIPART/MIXED; BOUNDARY="-1077017559-1521213240-1115126775=:9488" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ---1077017559-1521213240-1115126775=:9488 Content-Type: TEXT/PLAIN; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Tue, 3 May 2005, Eric Mahurin wrote: > I think you answered your own question - "sometimes memory > usage considerations are more important than flexibility". To > get this memory efficiency you would only be able to store > objects of one class because you would be storing only the data > per element - no class information. You wouldn't even be able > to put nil objects in for a homogeneous array - you may have to > pick some value to mean nil if you need that. It's not just the memory usage. When data is more tightly packed in RAM,=20 one benefits from cache locality (that is, your data is more often in=20 high-speed RAM than in low-speed RAM), and furthermore, if the data is in= =20 a CPU-native format, then you can do some pretty fast processing on it,=20 especially if using SIMD extensions such as MMX/SSE or Altivec. This is important for me, as I *am* doing live realtime video processing. (For that, I combine PureData, Ruby, C++, and then some asm). ,-o---------o---------o---------o-. ,---. irc.freenode.net #dataflow | | The Diagram is the Program (TM) | | ,-o-------------o--------------o-. `-o--------------o--------------o-' | | Mathieu Bouchard (Montr=E9al QC) = | | t=E9l=E9phone: +1.514.383.3801 `---' `-o-- http://artengine.ca/matju= -' ---1077017559-1521213240-1115126775=:9488-- ---1077017559-1521213240-1115126775=:9488--