What is the best version of iOS to use on an iPhone 3G? my girlfriend is currently using an iPhone 3G (iOS version 3.1.3 - 7E18) and I've noticed it can be very sluggish. She doesn't use it for much more than the usual messaging/safari/mail. Compared to my 3GS it is pretty terrible.

I used to have a 3G (still do in fact, and it runs much smoother/faster).

So my question is, what is the best version of iOS to run on an iPhone 3G?

I'm going to downgrade (if necessary, which I think might require jailbreak which I'm not thrilled about) or try a restore and see if that fixes it, but I'm not sure if it's even possible to restore her phone but keep it running 3.1.3.

Any advice would be greatly appreciated, thanks!
iOS is always being optimized, and Apple's OS's are known for running faster than previous versions, even on older hardware. iOS 4.0 was bad on the 3G, but 4.1 is much better.

As a rule of thumb, you're always best running the latest version of iOS, unless you're a jailbreaker and/or unlocker, in which case you should run the latest exploitable version of iOS and the baseband.