4

2

A list of `{Integer32, Real32}`

items in *Mathematica* seems to use 12-times as much memory than the `C`

equivalent array of structs. And it looks like it can't be stored in a packed array, due to the integer/real mix. Besides splitting the time-series into two lists, one of timestamps and the other of values, so that each one can be packed individually, is there any other strategy?

Also, *Mathematica* 9 has a new function – `TemporalData`

. Is that more efficient than a simple list?

Mathematica's

– halirutan – 2013-10-15T18:04:58.533`AbsoluteTime`

returns the Unix Time which is per default represented by a`Real`

. Isn't it a possibility to use this?@halirutan at least it's almost unix time:

`unixTime[date___]:=AbsoluteTime[date] - AbsoluteTime[{1970, 1, 1}]`

– ssch – 2013-10-15T18:16:15.383Hmm, the source is UNIX time, but Mathematica seems to convert them to

`Integer`

when I use the following function:`Epoch[timestamp_] = AbsoluteTime[{1970}] + timestamp`

– Meh – 2013-10-15T18:54:39.480How do you assert that an integer is represented by Integer32 in memory? As far as I can tell, you have no control on that. – Hector – 2013-10-16T01:23:02.033

@Hector I don't, I just load them using

`BinaryReadList`

using`{Integer32, Real32}`

. Even if Mathematica uses 64-bit ints/floats, there is still a 6x overhead over C. – Meh – 2013-10-16T01:46:38.603