Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Tests using OCMock run much slower in iOS 9 SDK #253
This does really seem to be caused by a change in the new iOS runtime. I've created two very similar projects, one for iOS and one for OS X, that demonstrate that the OS X version is still fast: https://github.com/erikdoe/ocmock-profiling
It might be possible to create a workaround, maybe caching the dynamic subclasses, but I'm hoping that the issue will get fixed in the runtime. The engineering team at Apple is already aware of the problem: https://twitter.com/joar_at_work/status/649330511177912320
One thing you might try is to add all the methods you know you need before calling objc_registerClassPair(). That may (in theory) avoid all of the cache flushes and locking etc. associated with adding those methods, because the class is not fully in the runtime system yet.