View Single Post
Old 12-15-2010, 10:47 AM   #15
chaley
"chaley", not "charley"
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: 4,919
Karma: 802172
Join Date: Jan 2010
Location: France
Device: Many android devices
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