dolphin-emu/dolphin — pull request #892 by comex (2014-08-28 00:26:56+00:00)
Title: Optimize PointerWrap.

PointerWrap currently checks its mode for every individual byte of everything it 'does', including all of RAM. Make it not do that.

Decreases total Wii state save time (not counting compression) from
~570ms to ~18ms.

The compiler can't remove this check because of potential aliasing; this
might be fixable (e.g. by making mode const), but there is no reason to
have the code work in such a braindead way in the first place.

- DoVoid now uses memcpy.
- DoArray now uses DoVoid on the whole rather than Doing each element
(would fail for an array of STL structures, but we don't have any of
those).
- Do also now uses memcpy (not DoVoid, in order to ensure each type gets
its own implementation, which for small types then becomes a simple
load/store in any modern compiler).