• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

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

Explorer ,
Jun 10, 2014 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!!

TOPICS
Development

Views

272

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
community guidelines

correct answers 1 Correct answer

Engaged , Jun 10, 2014 Jun 10, 2014

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 opp

...

Votes

Translate

Translate
Engaged ,
Jun 10, 2014 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?

Votes

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
community guidelines
Explorer ,
Jun 10, 2014 Jun 10, 2014

Copy link to clipboard

Copied

LATEST

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 !!

Votes

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
community guidelines