My application gathers acceleration 10 times a second, therefore I have a need to store thousands of rows of data. Currently I have an object which is a list of other objects to store it all – anything more efficient than that?
var arr = [];
function dataPoint(x, y, z, tstamp) {
this.xAccel = x;
this.yAccel = y;
this.zAccel = z;
this.epoch = tstamp;
}
var dp = new dataPoint( acceleration.x, acceleration.y, acceleration.z, acceleration.timestamp );
arr.push(dp);
If the platform you’re targeting supports typed arrays then those would probably be more efficient.