Originally Posted by MonarchX
|
|
I heard FAT32 is slower...
|
Not really true. See my accurate benchmarks & other stuff:
What do you need to know about optimizing storage card speed?
I've decided to collect all the information you need to know about storage card optimization because it's another unexplored/undescribed area, as far as Pocket PC-related articles are concerned.
First, what format should you use, if you have both a CF and an SD slot? Is it true that SD cards are much slower than CF cards? Not at all. Actually, it were only early Pocket PC models (most importantly, the Compaq iPAQ 38xx series) that had a very slow SD interface. Otherwise,
there're only usability-related differences between the two card formats except for some (very rare) exceptions like the
Dell Axim x50v (which has a considerably faster and better optimized SD interface than CF).
Second, what can I store on them? Almost anything
except
- mail
bodies that ActiveSync synchronizes to your
Messaging (in pre-WM2003SE parlance,
Pocket Inbox). Note that I've emphasized "
bodies that ActiveSync synchronizes" because attachments (see
this and
this thread) and WebIS Mail-downloaded (via POP3, not AS-synchronized Outlook ones!) mail can be stored on cards
- system databases
- the system registry
- by default, the RAM contents of the
\Windows directory: DLL's, help files, uninstallation-related files etc. You can, however, relocate most of them to an external storage card and/or the built-in File Store (if there is). This subject is too large to be discussed in this article; therefore, the reader is referred to
the Windows Mobile Technology relocation tutorials/tips; in addition,
I also recommend this thread.
- ActiveSync-synchronized files in \My Documents (you can, however, use
MobSync to circumvent this limitation).
It should be stressed that it's not only the
type of files/data that can be stored on storage cards that is different, but, fundamentally, the
speed of the medium, which is the main reason why PDA's have power-hungry, meagre (32/64/128 Megabytes) and expensive dynamic RAM memory at all, and why they don't use hundreds of Megabytes of simple/much cheaper flash ROM-based memory. Storage cards are two or even three orders of magnitude slower than RAM in cases; this is why they can't be used at all as, for example, dynamic program/system memory. The latter, for example, stores the heap/stack/the program code - this memory is constantly accessed/changed. If you, for example, change a variable in your program, then, the memory cell(s) holding that variable (assuming it's not a registry variable) is also changed. You can have an idea of how slow this would become if the flash ROM controller needed, say, 1-2 milliseconds to store this new value in the ROM...
In real life, because you can only use your card as a
storage medium (like your hard disk in your desktop PC), the speed problem won't be so apparent
unless you start doing fancy things like
- install applications that store tons (hundreds) of files on it and expect tolerable speed upon installation. Applications like this are
several IR remote controller apps (some of them store their device databases in separate files),
Pocket Informant (if you decide to manually relocate it),
the adventure Fade etc.
- relocate the Pocket Internet Explorer (PIE for short) cache to it (more on this relocation later), unless you optimize the card
- install NetFront on the storage card (NetFront has its cache directory in a subdirectory of its home directory by default
unless you have version 3.2+ and relocate the cache to somewhere else)
- start applications that require a
steady (not bursty!) transfer rate to the card. A particular example of the latter is
NoteM, the well-known MP3 recorder app (please read
this roundup and
this summarization for more info on this program and its alternatives). If your card has problems with these kinds of apps (because it's slow by nature or uses a file system that slows it to a crawl), it will not be able to keep up even with the moderate transfer rate requirements (56 kilobits/sec) of NoteM, let alone its high-quality (128 kilobits/sec) recording mode.
File systems
Storage cards are pretty flexible. You can use different so-called
file systems on a storage card as you can (to a certain degree) modify the (logical) characteristics of a, say, floppy disk. Remember the times of
800.com (
com in this case, is not a dotcom commerce site but an old MS-DOS extension type), which made it possible to store even around 840 kbytes on a 360 kbyte DS/DD 5 1/4 diskette? It achieved this by raising the track-per-inch ratio from 48 to 96, raising the sector-per-track ratio from 9 to 10 and raising the number of tracks (by an additional two or three) to 82-83? Storage cards aren't that flexible (you can't increase their capacity because they aren't magneto-mechanical units but have a pre-defined number of memory cells, which can't be increased), but still, the basics of floppy (or, for that matter, hard disks, where 'clusters' came into picture) file systems are still a good analogy.
So, what are file systems?
People interested in a technical description,
please read this. Also, the Wiki
article on File Allocation Table is worth reading for a more in-depth explanation of FAT16 and FAT32, the two file systems I'll be referring to. Please note that you don't need to actually
understand everything in there. Even the following will suffice:
There are two file systems used on storage cards: FAT16 (often referred to as FAT) and FAT32 . The one chosen for a given card have direct (without really benchmarking the card, not really predictable; in general, lower-end cards behave significantly better with FAT16) impact on the performance.
The so-called
cluster size is another very important parameter to pay attention to.
The less the cluster size, the less memory gets lost if you put smaller files on the card than the cluster size (or a multiple of the cluster size). This is because of a limitation of everything (hard disks, memory cards, USB memory dongles etc) FAT-based: if you put a file on these devices, let them be a hard disk or a memory card, more disk/memory space will be reserved for them than their actual size (except for the very rare case when the size equals exactly a multiple of the cluster size).
This means you'll lose 16 kbytes (minus one byte) of memory if you put a one-byte-long file on the card that has a file system using 16 kbyte cluster size. On the other hand, if it's using the absolute minimum, 512 bytes, "only" 511 bytes will be lost. This means you should always strive for using as small cluster sizes as possible (actually, this is what Resco File Explorer does when it formats memory cards, as we'll see).
Using the minimal, 512-byte clusters, however, may have an painfully severe impact on the file creation speed performance of the card. A card that, say, is able to create 200 files a minute when using 16 kbyte cluster sizes may be able to store an order of magnitude less files (say, 20) in a minute when used with 512-byte clusters. We will even see an example of this later. Not all cards are like this; but one of the tested cards, Kingston, definitely is.
Note that you can't use any values of the generally possible
512, 1024, 2048, 4096, 8192 bytes /
16, 32 or
64 kilobytes. I won't go into the math because it's not needed for having a picture of how everything works. Generally, it can be stated that the larger the card, the larger the minimal cluster size with
FAT16. For example, it's 4096 bytes with 256Mbyte cards; while, with 1Gbyte cards, it's four times more, 16 kbytes. On the other hand,
FAT32 is a bit less wasteful: the least wasteful cluster size, 512 bytes, can always be used with any card size (it's another question that almost all cards will be
much slower when used with 512 byte clusters). It, however, has upper limits: for example, you can't use bigger clusters than 2k with 256Mbyte cards. Not that you would want to use bigger cluster sizes because of the increased memory loss if you store numerous files on it.
The third parameter that directly affects performance is the existence of the
FAT backup table. They, in most cases (but not always!), make access to the card slower. In general, they're pretty useless and, therefore, can be left out.
How do I measure the performance of my card to find out whether it's optimally set up?
Forget the Pocket PC (and most of even the PC) benchmarking programs that (seemingly) do this. They deliver pretty useless and far-from-practice results. There're much better ways, much closer to real-world usage, to measure the
real performance of memory cards.
1. use a desktop card reader and copy, say, some hundreds of small (so that it's the file
creation and not the file
transfer rate that counts) files to your storage card. For example, in the first part of my tests (see the group in the table), I used
340 small files, copying them straight to the card. This will give you a desktop reader performance and you will surely see
huge differences, depending on the file system/cluster size used.
2. You can also make file transfer speed tests using your desktop card reader by benchmarking the copy of a large (at least tens of Megabytes) file. However, bad cards / bad file system configurations won't necessarily be spotted in tests like this. Actually, the comparatively good performance of, say, Kingston memory cards in tests like this is what makes most people think Kingston cards are perfectly OK. Yes, at 'plain' file transfer tests, they excel. For example, they can be read much faster than my high-end Ridata CF card. However, when it comes to other aspects of card performance, Ridata proves to be incomparably better.
3. so far, I've only discussed desktop-based benchmarking. Now come PDA-based ones. The most important of them is relocating the PIE cache to the storage card and loading a Web page that has tons of different images. These images will be stored into the cache one-by-one as the page loads and the target medium's slowness will have a
huge impact on how much time it takes to load the page (make sure you delete the cache between subsequent tests if you don't format the card!). An example page is
here. The reason for this test is
PIE's dependance on the speed of the cache medium. In the table, see the section
PIE cache speed (Pocket Loox 720) on this. As can be seen, PIE needs about three times more time to load the page if used with the Kingston card in the FAT32/enabled FAT backup mode than in the FAT16/16k/disabled FAT mode. With the same card! That's quite much of a difference, isn't it?
A side remark: how can you set the PIE cache directly? Grab a
registry editor (if you aren't afraid of manually editing the registry - in most cases, it's much more fun - and it's free! - than using pre-made programs to do the same) and manually editing
[HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Explorer\Shell Folders\Cache] :
In this case, I've just set it to put the cache directory structure in the root of my SD card.
Of course, you may also want to use well-known tools like
Tweaks2k2.NET for this purpose.
4. also, you may want to try conducting in-device file copy speed tests: copy some 10-20 Mbytes off the main RAM to the card. I've also made some tests to show that in these tests, in some cases, bad File System configurations (for example, Kingston + FAT32 with backup FAT) can much easier be spotted than in desktop card reader-only tests. See the
2210 in-device file copy speed test in the table. You'll notice that in FAT32/enabled FAT backup, the copying became much slower and burstier than otherwise. Note that this isn't the problem of/specific to the iPAQ 2210 - the card behaved exactly like this in a Fujitsu-Siemens Pocket Loox 720 (PL720 for short).
5. there is another usage scenario: that of applications that cause constant streaming (writing) to storage cards with (almost) no buffering. Any card behaviour like
'hey, wait 100 milliseconds and resend your data, I can't write the data you've sent right now' (this is what I mean by 'bursty' behaviour) will result in data loss with these applications. NoteM is a perfect example of them. To test whether your card/its file system configuration is able to cope with these kinds of applications, get NoteM, install it, go to
Tools/Options, click
Change, choose
High (or, with absolutely the worst cards/with the worst configurations, even
Medium) from the
Bitrate drop-down list and also set the target card in the
Default storage path group.
You may also want to check out the
2210, 128 kbps NoteM group in the summarization table on this problem. As can clearly be seen, the Kingston card is absolutely useless with NoteM if you format it to use FAT32. (I've also tested, also in FAT32/enabled FAT backup, Resco Audio Recorder in my favourite 19 kbps/32 kHz SPX mode. In that, I had no problems with the card. This application seems to buffer its output OK, unlike NoteM.)
What tools can I use to set all these File System parameters?
There're several tools for this purpose. On the desktop PC, the well-known
format utility (
Start/Run; enter
Command; in the new Command window you can both enter your format commands and see its final messages) is a decent tool (except for the fact that it can't be configured
not to create a FAT backup table). If you, therefore, do want (I would! With worse cards, the difference caused by the lack of the FAT backup can be tremendous!) a more enhanced tool, get the $9.00
SKTools (tested version 2.2.11).
To format/fine tune your card in SKTools, click the
Storage cards icon and go to
Tools/Settings to set the formatting parameters. For example, to set the file system, go to
Format with and choose either FAT16 or FAT32 from the drop-down menu:
With the built-in format utility of Windows, use the
/FS: parameter, with either the
FAT32 or the
FAT parameter like this:
format j: /q /u /FS:FAT32
(where substitute
j: with the actual card drive-name)
To set the cluster size, in SKTools, go to
Cluster size and choose the appropriate size:
while with the built-in format utility of Windows, use the
/A: parameter, with possible values
512, 1024, 2048, 4096, 8192, 16K, 32K or
64K, depending on the file system (FAT16 or 32) and the capacity of the card.
An example of formatting a card with FAT32, using 512 byte-large sectors with Windows' format utility:
format j: /q /u /FS:FAT32 /A:512
and, with SKTools,
There is one thing Windows' format tool isn't capable of: disabling the creation of the second (backup) FAT table. To disable this by hand (which is
highly recommended with low-end Kingston cards!), you
must use third-party tools. SKTools is also able to set this ('
Create backup FAT table'):
So is the $14.95
Pocket Mechanic (tested version 1.59) - see the '
Backup FAT' checkbox:
Note that Pocket Mechanic has some pre-defined settings:
Try
not relying on them because these settings are only generic and will not
necessarily result in the best results with your
particular card. For example, if you choose "
Not sure, optimize for free size", your card will be formatted with FAT32/512 bytes, which will be really lethal to file creation speed performance with Kingston cards. Also, if you choose "
Not sure, optimize for performance", you may also get sub-optimal results because it uses
FAT16/32 kbyte in that mode, and, as we will see in the summarizing table, it can't be safely stated '
the bigger the cluster size, the better the file creation speed', performance-wise. With the SanDisk 256M card, for example, 4096 byte-blocks are the best performance-wise, while 32K blocks are almost 50% slower; the same is true of (to a lesser degree) of the Ridata card.
Furthermore, unlike SKTools, Pocket Mechanic doesn't display an error message if a particular file system type / cluster size combination (for example, FAT16 + 512 bytes) is impossible to use. Then, it just silently switches to using in this case FAT32 and still reports the FAT16 format to be successful. In this regard, this utility is certainly inferior to SKTools.
(Please note that I've also compared SKTools and Pocket Mechanic
here, together with some other tools like MemMaid. If you want to get a decent system maintenance application, you will really want to read this roundup.)
The $14.95
Softwinter Storage Tools (version 2.0 ppc240), on the other hand, correctly displays the usable cluster sizes with a given file system type (in addition to letting the user not create a backup):
The $11.95
CNetX Flash Format (tested: version 2.62) does the same, FAT16-wise; as far as FAT32 is concerned, however, it has a tendency not to display the 512 bytes-size cluster size in the drop-down menu, which, at least when you benchmark your card (again, 512 byte-clusters will almost always prove significantly slower than 2-4kbyte clusters), may be a disadvantage:
Finally, if you use
Resco File Explorer 2005 (tested version: 5.20), you can't set anything:
It'll
always format your card for FAT32/512 bytes/no FAT backup. Therefore, in most cases, you will want to avoid using Resco File Explorer for formatting your cards.
Test results and generic observations
First,
here's the summarizing table.
Second, generic observations:
-
all cards had problems with the otherwise most economical solution, the FAT32/512-byte configuration. The worst card, the 1 Gbyte (latest model!) Kingston, became almost useless when storing a large(r) number of files on it. (Plain transfer speed didn't suffer that much, except for the long (about 25-30 seconds) pause at startup when transferring them.)
- worse cards benefit a lot from
sticking to FAT16 as opposed to FAT32; with top-quality cards (like the Ridata one), there're not much difference
- worse cards also benefit a lot from
disabling the FAT backup. On the other hand, top cards (Ridata in the test) can even do the opposite - its benchmark results were all better when the FAT backup was enabled than without it. So, it can't be stated '
always disable the FAT backup for better performance' as a hard-and-fast rule either.
-
The format utility of Windows always uses the minimal (read: least memory-wasteful) cluster size with FAT16 cards (with all the tested cards, it also resulted in the fastest configurations) if you don't specify it. With FAT32 cards, its defaults are either 2k or 4k. Therefore, after you've benchmarked your cards (for example, to find out whether the 512/1k/2k cluster sizes with FAT32 cause a big hit on performance or not), you may want to force an override on its default settings, if you still decide for using it for formatting your card (if disabling the FAT backup doesn't result in any speed increase - again, you can't disable the FAT backup creation with Windows'
format).
- SKTools uses a 4k default cluster size with large(r) cards and the 512byte minimum with smaller ones (again in FAT32). You may, therefore, also want to override the default settings (especially in the latter case - again, using 512 byte sectors can result in painful slowdowns!) in order to get the most performance out of your card.
- it's not in the table, but with
backing up the files from the card, formatting the card and copying the files back to the card, say, once in a month (depending on how many small files you move in there/delete) can be advantageous. For example, I've measured some 5-10% performance degradation when copying files to a fragmented card (the SanDisk SD, which is a pretty average card, performance-wise). If you don't want to manually copy files, you may also want to use a disk defragmenter tool. All the introdued PPC-based card handler apps (except for SKTools) are capable of doing this. (Don't, however,
try to fix file system errors with them!). Please also note that even top-notch cards like the Ridata one require this from time to time. For example, NoteM will also have problems (skips/pauses) with these cards if they become fragmented, especially during long (over one hour) recordings.
- finally, the otherwise very cheap Kingston SD cards really s*ck in FAT32 modes when it comes to anything else than just transferring a large file in a desktop reader.
Always try to avoid using FAT32 with them!
Third, some more detailed observations/comments (along with the list/explanations of the individual tests)
File creation speed, in desktop reader; with FAT backup (Windows' format utility) group: in this test, I've copied the above-mentioned 340 files (in a subdirectory - it should be stressed that you shouldn't put so many files in the root directory of any card because it can only store a given number of files - 128 AFAIK) to the card in a card reader and measured the time it took for the copy to complete.
I've created several sub-groups in this group, referring to the four main cases:
- FAT32 with FAT backup
- FAT16 with FAT backup (conventiently formatted with Windows'
format)
- FAT32 without FAT backup (formatted with SKTools; any other tool would have resulted in the exact same results)
- FAT16 without FAT backup
Let's examine the results!
FAT32 with FAT backup: as you can see, with cluster sizes 512 and 1024 bytes, the Kingston card was
really slow; the other two tested cards (the high-end Ridata and the cheapo SanDisk) produced tolerable (not much worse than with the most optimal case, that is, 2048 bytes with both of them) results. With cluster sizes of 4 kbytes (and above), the Kingston performance became adequate (but still much worse than with the other cards).
FAT16 with FAT backup: with the two 256Mbyte cards, the (minimal) 4kbyte cluster size was the best; with larger cluster sizes, they became more sluggish. With the Kingston card, the performance was equal with all the cluster sizes.
FAT32 without FAT backup: again, the cluster sizes 512 and 1024 bytes are equally useless with the Kingston card. It's only with 4 kbytes (and above) that its speed starts to be OK. Also note that the optimal cluster size settings for the two 256M cards are, again, 2 kbytes.
It's really worth comparing the numeric results to the
FAT32 with FAT backup results. As can be seen, disabling FAT backup really made the Kingston card fly - the speed difference is about four-fold. The SanDisk card has also became a bit faster. The Ridata card, on the other hand, became a bit slower.
FAT16 without FAT backup: the results are pretty similar to those of the case of
FAT16 with FAT backup. The Kingston and the SanDisk cards are a bit faster than with FAT backup; the Ridata card, on the other hand, slower, exactly as with FAT32.
Card reader copy speed measured with one large (110Mbytes) file group: this is the exact opposite of the previous group. It only measures the read/write speed, depending on the file system used, with one large file. As can be seen, even the otherwise worst-case scenario with Kingston (FAT32 with 512 byte clusters) results in the same desktop transfer speed as with optimized cases. (Actually, this is why many people think Kingston cards are good cards, even with FAT32!)
PIE cache speed (Pocket Loox 720) group: please see
this thread on the basics of the tests. I've made them with FAT16/32 with the most efficient cluster size, both enabled and disabled FAT backup. With the Kingston card, the differences are astonishing (as opposed to the Ridata card). Again, this test slows how slow the Kingston card is with FAT32.
(Incidentally, due to the file system/object store overhead, with perfectly tuned storage cards, using them may even be better than having the cache in RAM. This is why the
RAM row shows an actually worse result than with perfectly-tuned memory cards.)
2210 in-device file copy speed : this is another speed test with copying 8 files totalling 21 Mbytes; again, with the most optimal cluster size in the given (FAT16/32) mode. As can be seen, the FAT32/FAT enabled case really brought down the performance of the Kingston card.
Finally, the
2210, 128 kbps NoteM test was a NoteM test conducted on the iPAQ 2210. I've recorded some minutes of audio in 128 kbit mode and checked whether there were skips/pauses in the recorded stream. With the Kingston card, there were: they were most apparent when FAT backup was enabled, but also noticable with disabled FAT backup. Verdict: Kingston cards are useless with NoteM when formatted to FAT32.