slow file operations while having many files / big app size

Home / Forums / Marmalade Archive / General Development Questions / slow file operations while having many files / big app size
3 replies [Last post]
by: DeMoney
Status: Offline
Joined: 2011-11-30
Points: 4340

I have many files in my app. Like 1500 textures + 1000 models. Around 200mb mkb.
On the device (android) it takes more than 0.1 SECOND (up to 0.3 sec) for any file operation, like access(), fopen(), fread().

access + fopen + fread is half a second for a 300kb file! Hundred times more, than in the x86 debug simulator.

Is it marmalade that is so slow, or the android app's filesystem is so slow itself?

Including auto-derbh=1 in the deployment options have cut this time down to less then 0.01 second (wow, 50 times, still two times slower than in the x86 debug simulator, but not that insane).

I'd like to just live with this (also the apk is 4 times smaller), but the app now is just not working for weird reasons (no, really, i'm not trying to write in the archived files etc.). I'll write about it in more details in the derbh forum

So why, anyway, accessing the archived file is (much!) faster, then the regular file?

by: Wave 1
Status: Offline
Joined: 2011-12-07
Points: 160
The speed up is probably due

The speed up is probably due to the fact you're loading less data from the device storage into RAM.

Some devices have incredibly slow storage access times, so it is often quicker to load a smaller block of data into RAM and decompress it than it is to just load the raw, uncompressed data.

by: DeMoney
Status: Offline
Joined: 2011-11-30
Points: 4340
This is unlikely. The device

This is unlikely. The device is Samsung Galaxy S2 - should be not very slow. Each of acces/fopen/fread is slow, slower than 0.1 sec. Slowdown kicks in only when there are alot of files, when there are only a couple of them - it's even faster, then compressed.

by: waheyluggage
Status: Offline
Joined: 2011-07-22
Points: 2810
Hi There I get this issue

Hi There

I get this issue too. Not sure when it kicked in but on Android (Galaxy S1 and iPod Touch) my loading times went through the roof. On iPad 1 & 2 they were fine.

Derbh-ing everything sorted it. You might want to take a look at it - it comes as a bit of a surprise.

Latest Posts

Latest Comments

Top Contributors

  • Chris D : 27,010
  • MonRoyals : 26,970
  • Salman : 26,720
  • Jez Hammond : 20,130
  • pjan : 11,150
  • gjw : 10,350
  • Paolo Oliverio : 9,640
  • Beaker_2 : 8,390
  • Kite : 8,210
  • bluescrn : 7,810