How to speed up your iPhone 3G running iOS4
Hard Reset your iPhone 3G
Hard reset will clear all RAM buffers, caches, etc from your iPhone 3G memory. Perform the Hard Reset twice to get the desired effect. In order to Hard Reset your iPhone 3G follow simple steps listed below:
1) Press-hold the Home button (big circle below the screen) and the Sleep/Wake button (on top of the iPhone) simultaneously for 5 to 10 seconds.
2) Continue holding both buttons (Ignore the “Slide to power off”) until the iPhone shuts off and begins to restart.
3)You may let go when you see the silver Apple logo.You have completed a hard reset successfully.
Disable the backgrounds
It might be possible that while jailbreaking iPhone 3G on iOS 4 using redsn0w you have enabled backgrounds to give the icons a nice shadow effect. But the shadow processing consumes large amount of memory on your iPhone 3G making it sluggish in performance. You can disable the backgrounds by editing a file. Just follow the instructions below:
1) SSH in as root and install ericas utilities
2) Navigate to /System/Library/CoreServices/SpringBoard.app
3) Convert the plist we need from binary to xml so you can edit it in a text editor:
plutil -convert xml1 N82AP.plist
4) Edit N82AP.plist file, and change this line:
5) Save the file, respring (maybe reboot).
6) Navigate to settings, general, spotlight and uncheck everything except apps and contacts.
Restore the iPhone to Factory Settings
You can try restoring the iPhone 3G to factory settings but make sure you choose to set it up as a new phone rather than restoring your backups. Most of the users have reported that the method indeed speeds up your iPhone on iOS4, but you may end up loosing your data not synced with iTunes. In order to get your iPhone 3G to work smoothly again you need to sacrifice something.
Turn off Spotlight Search and Multitasking
Turning off spotlight search reduces the overall workload of the system. Just navigate to Settings -> General -> Home Button -> Spotlight Search, turn search indexing off for as many items as possible. Follow the instructions posted here to disable multitasking on iPhone 3G.
Downgrade your iOS 4 to 3.1.3
Finally, if none of the method is working for you then you may follow the guide posted in order to downgrade iOS 4.0 back to iOS 3.1.3.here