saoudrizwan / Disk

Delightful framework for iOS to easily persist structs, images, and data
MIT License
3.08k stars 170 forks source link

use serial DispatchQueue to dispatch IO task #45

Closed Beyond-Chao closed 5 years ago

Beyond-Chao commented 5 years ago

use serial DispatchQueue to dispatch IO task will be better ?

saoudrizwan commented 5 years ago

Disk is synchronous by design, in most cases I/O operations take milliseconds to execute so it's not worth executing outside the main thread, however Apple recommends running any I/O operations on a separate thread. I leave it up to you to decide to use Disk synchronously or on a different thread. Check out the Large Files section in the README.