for example i want to compare about "array of array of number" with "array of string" to store bits of static canvas/image that has Alpha more or less than 0.5, that i will need to read/access it later
i wonder which one would have least memory usage and probably faster?
var c =$('$myCanvas');
var d = c[0].getContext('2d').getImageData().data;
// access: d[3+4*(c.width()*y+x)] >= 0.5
vs
var n = [ [ 2147483647, 2147483647, 2147483647 ], [ 0, 0, 0 ], ... ]
// access: n[y][x/31|0] >> x%31 & 1
vs
var s = [ [ 255, 255, 255, 255, ... ].to_s(), [ 0, 0, 0, 0, ...].to_s(), ... ]
// access: n[y].charCodeAt(x/8|0) >> x%8 & 1
note that to_s() is custom function to convert array of byte to string similar to this one: https://codereview.stackexchange.com/questions/3569/pack-and-unpack-bytes-to-strings
those codes are probably wrong, it's just the concept that i will implement later
so, my question is, how to measure memory usage of d, n and s?