.mx is blazingly fast relative to .wl(.m)

Unfortunately, it is not terribly portable. Word-on-the-street is that it's cross-system compatible, but not necessarily cross-version or even cross-point-version compatible (although I haven't tested this).

Likely for that reason, LocalObject uses .wl to store objects.

Now, I can make it use .mx like so:

Block[{LocalObjects`$objectFile = "object.mx"},
   Put[1, LocalObject["test/a"]]

Block[{LocalObjects`$objectFile = "object.mx"},


But this feels is unstable and hacky.

Is there a better way?

  • 4
    $\begingroup$ It is cross-version compatible, but only forward: later versions read earlier MX. Since some recent release, this goes both ways. Earlier M can read MX written by later M provided that no new expression types are used. However, it is not 32/64-bit cross-compatible. $\endgroup$
    – Szabolcs
    Dec 4, 2017 at 10:34

1 Answer 1


What about Import/Export?:

Export[LocalObject["test/a"], 1, "MX"];

Import[LocalObject["test/a"], "MX"]


Import[LocalObject["test/a"], "Text"]

(This is a Wolfram Language binary dump file. It can be loaded with \ Get.)


(End of Wolfram Language binary dump file)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.