Reduced overhead of calling memoryUsage() on SimpleTypedData.

The new implementation is approximately 2x faster than the previous one.