# Efficient serialization across system images

**URL:** https://discourse.julialang.org/t/efficient-serialization-across-system-images/79781
**Category:** General Usage
**Tags:** question, serialization
**Created:** [April 21, 2022, 1:02pm UTC](https://discourse.julialang.org/t/efficient-serialization-across-system-images/79781 "2022-04-21T13:02:44Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![sstroemer](https://avatars.discourse-cdn.com/v4/letter/s/a88e4f/32.png) [@sstroemer](https://discourse.julialang.org/u/sstroemer)
#### Post date: [April 21, 2022, 1:02pm UTC](https://discourse.julialang.org/t/efficient-serialization-across-system-images/79781/1 "2022-04-21T13:02:44Z")

</div>

I’ve got a dictionary containing only `String` keys mapping to `Number`s. This is the result of a computation that runs on a server. Since I make use of [PyJulia](https://pyjulia.readthedocs.io/en/latest/index.html) to initiate the computation from a Python app, I’m using a custom system image (like mentioned [here](https://pyjulia.readthedocs.io/en/latest/sysimage.html)).

This comes with the problem, that I cannot properly read (using `Serialization.deserialize(...)`) the result using my local Julia after downloading the binary file. (Documented here: [Serialization · The Julia Language](https://docs.julialang.org/en/v1/stdlib/Serialization/#Serialization))

Is there any other way to efficiently serialize something like that into a file that can be shared across Julia installations? I know I could just write that `Dict` to a file myself, but I was kind of expecting there to be something semi-stable for “easy” data types.

---

<div class="post-metadata">

### Author: ![tisztamo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tisztamo/32/16200_2.png) [@tisztamo](https://discourse.julialang.org/u/tisztamo)
#### Post date: [April 21, 2022, 3:51pm UTC](https://discourse.julialang.org/t/efficient-serialization-across-system-images/79781/2 "2022-04-21T15:51:36Z")

</div>

As far as I know, there is no “semi-stable” serialization mechanism in Base, unfortunately.

If an extra dependency is not a problem, then MsgPack is simple:  
[https://github.com/JuliaIO/MsgPack.jl](https://github.com/JuliaIO/MsgPack.jl)

From the docs:

```julia
julia> bytes = pack(["hello", Dict(:this => 1, ['i', 's'] => 3.14, "messagepack!" => nothing)])
42-element Array{UInt8,1}:
 0x92
 0xa5
 0x68
 ⋮

```

In your case I think even JSON may be a good choice.

---

<div class="post-metadata">

### Author: ![sstroemer](https://avatars.discourse-cdn.com/v4/letter/s/a88e4f/32.png) [@sstroemer](https://discourse.julialang.org/u/sstroemer)
#### Post date: [April 21, 2022, 4:28pm UTC](https://discourse.julialang.org/t/efficient-serialization-across-system-images/79781/3 "2022-04-21T16:28:16Z")

</div>

Thanks for pointing me to `MsgPack`, didn’t know that one and that will be helpful!
