Ideal block size for recording streaming content to disk on iPhone

I am writing an application that caches streaming content from the Internet to an iPhone. Right now I am saving data to disk as it arrives (in block sizes from 1 KB to 60 KB), but the application response is somewhat sluggish (better than I expected, but still pretty bad).

My question is: does anyone have a thumb rule, how often should large entries in the deviceโ€™s memory maximize performance?

I understand that this is similar to an application, and I intend to perform performance tuning for my scenario, but this usually applies to any application on the iPhone that loads a lot of data, because there is probably a sweet spot (if there is sufficient input data availability) for frequency / size records.

These are the resources that I have already read related to the problem, but no one addresses the specific problem of how much data accumulates before the reset:

The best way to download large files from the Internet to iPhone for burning to disk
The joy in finding you is an idiot

+4
source share
1 answer

After a year, I finally got to writing a test harness to test the download performance of streaming downloads.

Here's the setup: use iPhone 4 to download a large file over a Wi-Fi connection * with asynchronous NSURLConnection . Periodically download downloaded data to disk (atomically) when the amount of downloaded data exceeds a threshold value.

And the results: It does not matter. The difference in performance between the 32 kB and 512 kB blocks (and several sizes between them) is less than the difference between runs using the same channel size. The file download time, as expected, is almost entirely related to the network latency.

* Average throughput was about 8 Mbps.

+5
source

Source: https://habr.com/ru/post/1303420/


All Articles