# Ways to write/load h5ad file faster?

**URL:** <https://discourse.scverse.org/t/ways-to-write-load-h5ad-file-faster/1181>\
**Category:** scanpy\
**Created:** [March 1, 2023, 10:02am UTC](https://discourse.scverse.org/t/ways-to-write-load-h5ad-file-faster/1181 "2023-03-01T10:02:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![polklin](https://avatars.discourse-cdn.com/v4/letter/p/8dc957/32.png) [@polklin](https://discourse.scverse.org/u/polklin)\
**Post date:** [March 1, 2023, 10:02am UTC](https://discourse.scverse.org/t/ways-to-write-load-h5ad-file-faster/1181/1 "2023-03-01T10:02:07Z")

</div>

Hello,

I am working with a dataset of size (n\_obs=25060, n\_vars=18955).  
After pre-processing steps, I saved my file using `xd.write('pre_processed.h5ad')`, `xd` being my scanpy object.

I then reload this file using:  
`xd = sc.read('pre_processed.h5ad', cache=True)`.

I takes approximately 10 minutes on my machine (62GiB of RAM).  
I was wondering if there are ways to make writing / loading faster ?

Thanks in advance !  
Best,  
Paul

---

<div class="post-metadata">

**Author:** ![polklin](https://avatars.discourse-cdn.com/v4/letter/p/8dc957/32.png) [@polklin](https://discourse.scverse.org/u/polklin)\
**Post date:** [March 10, 2023, 1:50pm UTC](https://discourse.scverse.org/t/ways-to-write-load-h5ad-file-faster/1181/2 "2023-03-10T13:50:07Z")

</div>

The issue was not coming from scanpy, but it was due to the environment I was working on.  
The file I was loading was NFS mounted (which I did not know).  
Copying this file to a local disk solved the issue.
