Cilph/RemoteTech2 — pull request #167 by Faark (2013-12-05 13:06:28+00:00)
Title: Performance optimization in HasLineOfSightWith

Hey guys,
i did some performance analysis on RT. It isn't bad, but i did find an unnecessary hot code path that is easy to fix, so please check out 7a726d1. VesselSatellite.Position is currently quite costly due to looking up the SignalProcessor, so we should avoid repeated calls in a loop for no reason.
SignalProcessor is very frequently used in general, so it might be a good idea to somehow cache it, at least / especially for unloaded vessels that should barely change, i guess.

Other optimizations will be far more extensive and/or require knowledge of whats actually going on. I'll link my profiling data, in case you want to have a more in-depth look.

Used savegame from: http://forum.kerbalspaceprogram.com/threads/60212-Remote-Tech-Gallery?p=816082&viewfull=1#post816082
Profiling before 7a726d1: https://drive.google.com/file/d/0B-ewfC7WBS6abEFCaGVQWTczQ3M/edit?usp=sharing
After applying 7a726d1: https://drive.google.com/file/d/0B-ewfC7WBS6aU0gzeUYzRlJhZjA/edit?usp=sharing

You might want to ignore the other commit, but i prefer my super expensive & high-tech cockpits to allow control of the attached or other vessels without additional command parts. And i haven't figured out any other way to do this :)

regards & thanks for that great mod,
faark