# reading pre saved .fif is slower than parse raw .edf

**URL:** <https://mne.discourse.group/t/reading-pre-saved-fif-is-slower-than-parse-raw-edf/4234>\
**Category:** Support & Discussions\
**Tags:** data-import\
**Created:** [January 6, 2022, 9:24pm UTC](https://mne.discourse.group/t/reading-pre-saved-fif-is-slower-than-parse-raw-edf/4234 "2022-01-06T21:24:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mishashevelinn](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/mishashevelinn/32/1057_2.png) [@mishashevelinn](https://mne.discourse.group/u/mishashevelinn)\
**Post date:** [January 6, 2022, 9:24pm UTC](https://mne.discourse.group/t/reading-pre-saved-fif-is-slower-than-parse-raw-edf/4234/1 "2022-01-06T21:24:19Z")

</div>

- MNE version: e.g. 0.24.1
- operating system: Windows 10

Dear mne community! My goal is to avoid repetative parsing, since I’m working with large EDF files. My idea was to save raw object to file, so if I modify my script and want to apply it to the same data many times, I don’t have to parse the EDF each time, but load pre-saved raw object. I assumed that there are some tools, that allow to achieve this.

I tried to pre-save the data in .fif format and then load it with `read_raw_fif()` but it turns out to be slower than `read_raw_edf()` what is actually parsing I won’t to avoid.  
I’m not familiar with .fif formal so it probably EDF style format but maybe even heavier.

Additional thought was to save the data array which is `np.ndarray` but then how do I construct `raw` object with this pre-saved matrix? I have to have all metadata(headers, sampling frequency, ect) to build proper `raw` object…

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![drammock](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/drammock/32/4_2.png) [@drammock](https://mne.discourse.group/u/drammock)\
**Post date:** [January 6, 2022, 10:35pm UTC](https://mne.discourse.group/t/reading-pre-saved-fif-is-slower-than-parse-raw-edf/4234/2 "2022-01-06T22:35:22Z")

</div>

did you try using `read_raw_fif(..., preload=False)`? That keeps the data on disk and only loads it into RAM when needed (for filtering, plotting, etc)

---

<div class="post-metadata">

**Author:** ![mishashevelinn](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/mishashevelinn/32/1057_2.png) [@mishashevelinn](https://mne.discourse.group/u/mishashevelinn)\
**Post date:** [January 7, 2022, 3:16pm UTC](https://mne.discourse.group/t/reading-pre-saved-fif-is-slower-than-parse-raw-edf/4234/3 "2022-01-07T15:16:44Z")

</div>

Thank you! Did the job 😁
