mono/MonoGame — pull request #1115 by RayBatts (2012-12-28 02:07:00+00:00)
Title: iOS threading improvement

After some profiling, I noticed some overhead in our SetData calls for IBs and especially VB's. After some poking around, I found out that us allocating a new Action object every call was part of the problem. We only need to create an action object and pass it through the threading functions if we're not on the UI thread. I moved the internals of these calls into their own functions, and call them directly if we're on the correct thread. Our game saw a 2-4FPS performance boost from this alone.

If there's a more elegant solution, I'm all ears. I'm not in love with calling IsOnUiThread() twice now.