# Serialization compresses very well?

**URL:** <https://discourse.julialang.org/t/serialization-compresses-very-well/13602>\
**Category:** General Usage\
**Created:** [August 17, 2018, 5:51am UTC](https://discourse.julialang.org/t/serialization-compresses-very-well/13602 "2018-08-17T05:51:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tk3369](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tk3369/32/2824_2.png) [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Post date:** [August 17, 2018, 5:51am UTC](https://discourse.julialang.org/t/serialization-compresses-very-well/13602/1 "2018-08-17T05:51:02Z")

</div>

It’s interesting to observe the size of an array of string data (in Julia 0.7):

- In memory =\> 22 MB
- Serialized =\> 8 MB
- JLD2 =\> 40 MB

```julia
julia> x = [randstring(6) for _ in 1:1000000];

julia> Base.summarysize(x)
22000040

julia> open("/tmp/x.jo", "w") do file serialize(file, x) end

julia> @save "/tmp/x.jld2" x

shell> ls -l /tmp/
-rw-r--r-- 1 tomkwong wheel 40001228 Aug 16 22:43 x.jld2
-rw-r--r-- 1 tomkwong wheel 8000016 Aug 16 22:43 x.jo

```
