tangrams/tangram-es — pull request #34 by blair1618 (2014-12-17 18:34:19+00:00)
Title: Preallocation in geometry building

I spent a little time trying to pre-allocate std::vectors in our geometry construction process (since there are many case where we know their final size ahead of time). Turns out this can have a big impact on performance for phones!

Testing on our iPhone 5s, we see the following metrics:
```
Avg. Time Baseline: Avg. Time Prealloc: Delta:
buildPolygon: 185ms 180ms -2.7%
buildPolygonExtrusion: 90ms 50ms -44%
buildGeneralPolyline: 11ms 4ms -64%
```
The tessellation step still dominates the overall cost, but building many geometries can be made twice as fast simply by preallocating vectors with `std::vector::reserve()`