Blender Git Loki

Git Commits -> Revision 0f2ae61

Revision 0f2ae61 by Lukas Stockner (master)
January 14, 2021, 21:03 (GMT)
Use mmap() IO for reading uncompressed .blends

Instead of submitting tons of tiny IO syscalls, we can speed things up
significantly by `mmap`ing the .blend file into virtual memory and directly
accessing it.

In my local testing, this speeds up loading the Dweebs file with all its
linked files from 19sec to 10sec (on Linux).

As far as I can see, this should be supported on Linux, OSX and BSD.
For Windows, a second code path uses `CreateFileMapping` and
`MapViewOfFile` to achieve the same result.

Reviewed By: mont29, brecht

Differential Revision: https://developer.blender.org/D8246

Commit Details:

Full Hash: 0f2ae614a17a7c231b2a6e129633a99d9d1f12e3
Parent Commit: 33a558b
Lines Changed: +376, -375

2 Added Paths:

/source/blender/blenlib/BLI_mmap.h (+59, -0) (View)
/source/blender/blenlib/intern/BLI_mmap.c (+233, -0) (View)

2 Deleted Paths:

/intern/guardedalloc/intern/mmap_win.c (+0, -294)
/intern/guardedalloc/mmap_win.h (+0, -50)

9 Modified Paths:

/intern/guardedalloc/CMakeLists.txt (+0, -6) (Diff)
/source/blender/blenlib/CMakeLists.txt (+2, -0) (Diff)
/source/blender/blenloader/intern/readfile.c (+66, -2) (Diff)
/source/blender/blenloader/intern/readfile.h (+3, -1) (Diff)
/source/blender/imbuf/intern/allocimbuf.c (+1, -1) (Diff)
/source/blender/imbuf/intern/IMB_allocimbuf.h (+1, -1) (Diff)
/source/blender/imbuf/intern/readimage.c (+11, -13) (Diff)
/source/blender/makesdna/intern/CMakeLists.txt (+0, -6) (Diff)
/source/blender/makesrna/intern/CMakeLists.txt (+0, -1) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021