Quote:
Originally Posted by kovidgoyal
And as for load time, store the images in the zip file without compression then loading them from the zip file will be just as fast as loading them from the filesystem.
|
Wouldn't it be even faster if the method took a list of names and returned a dict {name: file_contents, }? That would permit the zip to be opened once to retrieve all the resources. Instead of ValueError, it could return {name: None} if it can't find a particular resource.