I have a problem with the following piece of Mathematica code:
A = Import["fileA.mx"];
B = Import["fileB.mx"];
The following evaluates to True:
A === B
however the size of one file is about 10 times greater then the size of the other one.
Both files were created in Mathematica using the same Export[" incantation. What's going on here?
Answer
I think I figured out what was going on.It looks like it all boils down to how MX stores files. I'll use a small example (in reality the tables were much larger), exporting:
{Table[0 , {64} , {64}] , 1 , 2 , 3 , {Table[0 , {64} , {64}]}}
will produce a significantly larger MX file size then exporting:
{zerotable , 1 , 2 , 3 , {zerotable}}
with
zerotable = Table[0 , {64} , {64}]
evaluated beforehand.
Comments
Post a Comment