what do you mean "optimize"?
if your gps isnt working,the trick to makeing it work with AOSP roms is to restore a stockish sense rom,and get it working there. get a good lock on as many satelites as possible with GPS status,and/or get your location accurate to 2 m or less with maps. restore your AOSP bacup,and voila! gps should work. it also helps to have gps status download a-gps data.