View Single Post
Old 12-15-2010, 10:47 AM   #15
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,738
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by kovidgoyal View Post
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.
chaley is offline   Reply With Quote