There’s been various reports of poor battery life in particular with the iPhone 3G and iOS 4. After updating I noticed battery life was reduced for my phone, but not as bad as many others were reporting (I’d say a ~15% reduction in battery life). I did however find what appears to be a fix. It’s quite simple actually.
Plug in your iPhone 3G either to the wall charger or your computer’s USB port and let it charge while on for several hours (overnight should be cool). Power down your phone, then turn it back on. For me this brought the phone’s battery life back to where it was before the update.
Why does this fix work? I’m not sure but I do have a theory. It appears when the OS was upgraded your spotlight database needed to be updated. This requires indexing all the data on your phone. Needless to say all this effort kills your battery. Apple must have some algorithm in place to do this work and preserve battery life but it obviously changed between iOS 3 and iOS 4. By leaving it plugged in it appears to complete the process and by restarting it will make sure that any hanging process on your phone is killed and memory fragmentation is cleaned up. iOS 4 runs tight, swapping kills performance and battery life. This also seems to help performance as my phone doesn’t lag as much anymore (though it’s hardly a speedster like the iPhone 4). It also explains why some people would see different levels of the problem as it would depend on how much you have to index.
Let me know if this fix works for you.