Currently when CGUIManager::SendEventToAll is called it sends the event recursively to all gui objects whether they have set a script handler for that event or not. This diff optimizes this so only those that have it set are called.
Profiling information: in my case, on average, I saw the gui tick time go down from 1.5 msec/frame to 0.6 msec/frame while in session, so about 2x the performance.
Should be easy to validate the code is correct as the changes are pretty simple.
The only possible concern could be that now the script handlers may not be called on the same order as there were called previously.