sebastianbergmann/phpunit — pull request #1478 by willemstuursma (2014-10-21 09:38:23+00:00)
Title: Improve performance of isEqual() by skipping Comparator Factory

For our case, a lot of time during test evaluation is spent on the comparison of different values through the `assertEquals()` assertion. See for example the performance trace of a test run:

![Webgrind run of our tests](https://i.imgur.com/klo4chp.png)

This PR will change PHPUnit to do a quick strict comparison check before doing an equality check. This check is very cheap, and is the most common case during test runs. If the expected and the actual value are not identical, the existing code path is followed and the Comparator library is used.

Performance of tests with this patch:

```
Time: 56.02 seconds, Memory: 261.00Mb

OK, but incomplete, skipped, or risky tests!
Tests: 4488, Assertions: 10734, Incomplete: 2, Skipped: 22.
```

Performance with base PHPUnit (4.3.1)

```
Time: 1.21 minutes, Memory: 261.00Mb

OK, but incomplete, skipped, or risky tests!
Tests: 4488, Assertions: 10734, Incomplete: 2, Skipped: 22.
```

Performance improvement is about 25-30%.