# JLD: lazy loading of \`Dict\`?

**URL:** https://discourse.julialang.org/t/jld-lazy-loading-of-dict/8115
**Category:** General Usage
**Created:** [January 2, 2018, 8:02pm UTC](https://discourse.julialang.org/t/jld-lazy-loading-of-dict/8115 "2018-01-02T20:02:59Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![ExpandingMan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/expandingman/32/866_2.png) [@ExpandingMan](https://discourse.julialang.org/u/ExpandingMan)
#### Post date: [January 2, 2018, 8:02pm UTC](https://discourse.julialang.org/t/jld-lazy-loading-of-dict/8115/1 "2018-01-02T20:02:59Z")

</div>

I’m wondering if it’s possible to lazily load a `Dict` from a JLD file, or the equivalent thereof, by which I mean, if I have a JLD file of size N I want to load values from my `Dict` only touching n\ll N bytes of the file. This is basically what happens with memory mapping, as I understand it, but it’s not at all clear to me that if `mmaparrays=true` something like this will happen with data structures other than arrays. A broader explanation of what happens when `mmaparrays=true` would also be appreciated.

A work around would be to have an intermediate `Dict` that mapped values of an arbitrary types to strings, and then storing values in the HDF5 file labeled by strings, but that’s just a big ugly pain in the ass.

Thanks all.

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [January 3, 2018, 8:07am UTC](https://discourse.julialang.org/t/jld-lazy-loading-of-dict/8115/2 "2018-01-03T08:07:07Z")

</div>

I don’t think it is possible. A `Dict` has a complex internal structure, loading half of it is difficult.

> [@ExpandingMan](#):
>
> A broader explanation of what happens when mmaparrays=true would also be appreciated.

AFAICT if it encounters an array that it can `Mmap` in the HDF5 structure, it does that. This rules out compression and non-bitstypes.
