Just found a useful post at Neowin about speeding up your iphone if its going slow after the upgrade to OS 4. Tried it and it seems to work for me. Check it out if your laggin
http://www.neowin.net/news/sluggish-ios-4-performance-on-the-3g-we-have-the-fix