More Persistent Storage Stuff part 2
A continuation of my "More Persistent Storage Stuff" entry, which is a follow up to "Why Persistent Storage Is A Good Thing." These are responses to questions asked in various places as a result of the first post.
Performance concerns
Flash can be 10+ times slower than RAM. Won't that mean the device is going to crawl? No, not really. Again, remember that this isn't a new trail we're blazing. We've been doing this for years, and many others did it before us. In many cases, we buffer the data first and write it out in the background. In other cases, even going ten times slower isn't something you'll notice. Something could go from taking 1/100 of a second to 1/10 of a second and you still wouldn't notice it. Also realize that this change doesn't do much for application launch times. Application code has always been stored in ROM.
That said, flash is slower than RAM, and there are places you'll notice it. Any place where you need to write a LOT of data, you'll likely see a slowdown. For instance, the initial sync where you've got 400 contacts, 100 calendar appointments, and 1000 emails (that's typical for me). I definitely see that taking longer than it would if it were going into RAM. But subsequent syncs don't bother me much. Another potential place is large 3rd party applications. A while ago I wrote a flashcard program to help me study Japanese. The dictionary that it needed to load on start was 5 Megabytes. Storing that in RAM would have gone faster than storing it in flash. Of course, I still stored it in flash (on a storage card), because I didn't want to eat up that much RAM. But if you've got an app with an enormous (for a small device) dataset that you need to read and write regularly, you may see it take longer than it used to.
But I don't expect typical user scenarios of reading email, browsing the web, listening to music, etc. to be affected.
Is 64M RAM enough?
A number of posters have said that they want more than 64M of RAM. I have a number of things to say about this.
- Realize that moving to Persistent Storage (PS) frees up a significant amount of RAM. Before PS, RAM was split between storage and applications. Every file you put on your device lowered your RAM by the size of that file. By moving files to PS, all of the RAM can be used as RAM.
- Microsoft doesn't have any "maxium RAM" requirements. If an OEM wants to put in more than 64M, we won't stop them. We do have a battery life requirement, though, so they have to put in a big enough battery to compensate for more RAM. If there's a market for devices with more than 64M, an OEM will release a device to serve that market.
- Because of the 72 hour rule, it was almost impossible to do 256M RAM devices in the past. Now that PS has removed the 72 hour rule, those devices are possible. I don't think it's likely that you'll see 256M RAM devices, but, again, if there's a market for them, OEMs can make them now.
Modern batteries don't like to be discharged
Lithium Ion and Lithium Polymer batteries don't like being fully discharged. If you let them discharge completely, it will start to damage them. An argument has been made that, since it was catastrophic to discharge the batteries before (you lost your data), no one did. Now that you don't lose your data, maybe people will be more lax about this and ruin their batteries as a result.
This is true, but I disagree that it's an argument for not going to PS. If you're concerned about your battery, don't let it discharge all the way. That was true before PS and it's still true afterward. If anything, the world is in a better spot now, because PS makes it easier to do removable batteries in PocketPC. Pre-PS you ran the risk of losing your data on swapping batteries, so OEMs avoided it. Now that's not a problem, so OEMs have an easier time doing removable batteries. At least with removable batteries, if you ruin one, you can get a new one for a fraction of the cost of a new PocketPC.
Suspend vs. Shutdown
I didn't go into enough detail on this. Although PocketPC now has the Smartphone Persistent Storage scheme, it still has a different power scheme. The differences in their power schemes would fill an entire blog entry (yes, I'll do one on that subject later). But, briefly, the PocketPC power system didn't fundamentally change. It still suspends, just like before. It doesn't do a full shutdown, the way a Smartphone does. The main differences in this regard between WM2003SE and WM5 are that the 72 hour requirement has been removed, and we flush cached data to flash on suspend. (We do it with the screen off so you don't realize we're doing it.)
Ram vs. other power drainers
People correctly pointed out that the backlight and the CPU burn more power than the RAM does. However, I ask that you reread my description of the 72 hour rule. That rule caused a 128M RAM device to reserve half of a typical battery's charge. Removing that is huge. Also, the typical user has his or her device suspended for a larger percentage of time than it is running. Most people have it suspended while they're sleeping, etc. When the device is suspended, the backlight, CPU, and screen are off. During that time, your RAM is still burning power. On a non-phone device, RAM is basically the only thing burning power when suspended. Twice as much ram there means half as much suspend time.
Other things we could have done instead
Some people asked why we didn't give you a slider to make your own choices regarding the 72 hour rule. Many of the iPAQ devices do exactly that. We didn't go that route because the 72 hour rule wasn't the main problem we were trying to solve. The main problem we were trying to solve was the bad story that, if you forgot to plug your device in over the weekend, you'd lose your data. I know that power users learned to live with that. I've never lost my data due to forgetting to charge my devices. But the story had to be fixed. Devices shouldn't bend us to their needs. It is the devices that need to bend to our needs. And needing to worry about finding a power outlet every few days to keep something catastrophic from happening was just wrong. That was the problem we were trying to solve. Being able to remove the 72 hour rule was gravy. Really, really tasty gravy, but gravy nonetheless.
Others asked why we didn't implement what amounts to laptop hibernate. We talked about that. Trouble is, it's terribly inefficient. Either you write the entire contents of the user store to flash, or you implement everything we did for persistent storage. The former would be too slow. And, if you're doing the latter anyway, why not just go all the way to PS and not waste the RAM? The basic trouble with the hibernate solution is that it requires two copies of everything, one in RAM and the other in ROM. Laptops can get away with this because they have more storage than they know what to do with. But that's not the case yet with PocketPCs. So we've got to be efficient with our use of RAM and ROM.
What happens when a bad guy gets my device?
Someone posted that they felt secure in the knowledge that if someone got their device, it would eventually run out of power and their data would be cleared. This is a false sense of security. If you've got data on your device you don't want to fall into the wrong hands, you absolutely, positively, should password protect it. If someone takes your device to get your data, they're not going to forget to plug it in.
As for the question of whether or not there's a mechanism to clear your data (cold boot) in Persistent Storage, yes there is. All OEMs will provide some mechanism for erasing your user data. The mechanism will be different from device to device, but every device will have it.
Innovation
There have been a number of posts berating us for waiting until 2005 to do PS on PocketPC. We deserve those. I wish we had done PS a long time ago. No great conspiracy here. Just a ton of stuff to do and not enough time to do it all. You can argue that we should have done PS before features X, Y, or Z that we did in the past, but other people would say that, no, those features were more important. We're doing our best to make the right product, and we're willing to keep working at it. Whether PS is thirty years late as a recent feedback implied or just in time as another did, I'm just glad we've got it now.
Others have pointed out that this or that product had PS before us, so therefore we're not "innovative." Folks, I never said Persistent Storage is innovative. I said that it's a good thing.
Some of the stuff we do is innovative. Some of the stuff we do is keeping up with the Joneses. This is how every single competitive product on the planet works--from automobiles to zoology. And this is how it's been since the dawn of time. Some of you will scream shrilly that "M$" has never done a single innovative thing. And, though I disagree, nothing I could ever write would convince you otherwise.
No, there's nothing innovative about Persistent Storage. If a marketing guy tries to tell you otherwise, send him to me. But PS is a good thing.
Mike Calligaro