AnalyticalGraphicsInc/cesium — pull request #140 by pjcozzi (2012-07-29 21:39:14+00:00)
Title: Specs performance

This moves context and scene creation from per-spec to per-suite to improve the performance and stability of our tests.

When running all tests, Firefox went from ~95 to ~30 seconds. Chrome went from ~230 to ~28 with improved stability. These numbers are on my laptop with an NVIDIA card and ANGLE on.

The trade-off is individual specs are not as well isolated; however, suites still are. So the execution of one spec can - and did in several cases - affect the execution of another spec in the same suite. Considering that this is an op-in trade-off, and the dramatic performance improvement, this is something I can live with.

The bottleneck is now compiling and linking shaders - taking ~56% of the total time. We can improve this with a similar strategy if needed.

We should also consider adding `beforeAll`/`afterAll`to Jasmine (CC @shunter @kristiancalhoun). This is something I've thought about for over a year, but now we could really use it. It would avoid having to hackup `beforeEach` like I've done, and also avoid hacked specs for destroying resources.