Highlighted

Time to load images using Loader from File.applicationDirectory or File.applicationStorageDirectory

Explorer ,
Jun 10, 2014

Copy link to clipboard

Copied

While I test to load many images using Loader from File.applicationDirectory or File.applicationStorageDirectory, I found something strange.

It took about 2 times longer to load images from File.applicationDirectory than from File.applicationStorageDirectory.

I have googled for a long time, but I found why.

Does anyone know why?

Thank you!!

Is this on Android by chance? If so it makes sense. On Android the applicationDirectory assets are stored in the original .apk (zipped) format and File I/O is automatically abstracted for you so that you think you are accessing files on the filesystem but what you are also doing is extracting the bytes of the files from the zipped contents first.

Same effect can be seen when you see slower copy operations when copying a bunch of individual files one at a time from File.applicationDirectory as opposed to copying a .zip from applicationDirectory and expanding the zip in another directory instead. Mentioned in this discussion:

File.copyTo (and copyToAsync) extremely slow on Android. e.g. 1/2 second per tiny XML file. Help?

TOPICS
Development

Views

197

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Time to load images using Loader from File.applicationDirectory or File.applicationStorageDirectory

Explorer ,
Jun 10, 2014

Copy link to clipboard

Copied

While I test to load many images using Loader from File.applicationDirectory or File.applicationStorageDirectory, I found something strange.

It took about 2 times longer to load images from File.applicationDirectory than from File.applicationStorageDirectory.

I have googled for a long time, but I found why.

Does anyone know why?

Thank you!!

Is this on Android by chance? If so it makes sense. On Android the applicationDirectory assets are stored in the original .apk (zipped) format and File I/O is automatically abstracted for you so that you think you are accessing files on the filesystem but what you are also doing is extracting the bytes of the files from the zipped contents first.

Same effect can be seen when you see slower copy operations when copying a bunch of individual files one at a time from File.applicationDirectory as opposed to copying a .zip from applicationDirectory and expanding the zip in another directory instead. Mentioned in this discussion:

File.copyTo (and copyToAsync) extremely slow on Android. e.g. 1/2 second per tiny XML file. Help?

TOPICS
Development

Views

198

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jun 10, 2014 0
Engaged ,
Jun 10, 2014

Copy link to clipboard

Copied

Is this on Android by chance? If so it makes sense. On Android the applicationDirectory assets are stored in the original .apk (zipped) format and File I/O is automatically abstracted for you so that you think you are accessing files on the filesystem but what you are also doing is extracting the bytes of the files from the zipped contents first.

Same effect can be seen when you see slower copy operations when copying a bunch of individual files one at a time from File.applicationDirectory as opposed to copying a .zip from applicationDirectory and expanding the zip in another directory instead. Mentioned in this discussion:

File.copyTo (and copyToAsync) extremely slow on Android. e.g. 1/2 second per tiny XML file. Help?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 10, 2014 0
SangHee LATEST
Explorer ,
Jun 10, 2014

Copy link to clipboard

Copied

Yes, on the Android device.

I am developing a mobile game and I tested image loading time.

Now, it loads many thumbnail images from File.applicationDirectory.

I will have to find another way.

Thank you very much !!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 10, 2014 0