Merge: Optimize `Array::add_all`
authorJean Privat <jean@pryen.org>
Sun, 28 Dec 2014 14:48:16 +0000 (09:48 -0500)
committerJean Privat <jean@pryen.org>
Sun, 28 Dec 2014 14:48:16 +0000 (09:48 -0500)
Calls to `Array::add_all` were a noticable bottleneck in gammit, so I optimized it. The opimization is even more efficient when adding Arrays to Arrays, compared to adding Sequences to Arrays. It is general enough that it could be useful in the standard library (but I could also keep it in gammit if you prefer).

Speeds up the benchmark program by about 60%, with even better effects when adding larger arrays.

We could probably optimize this further at the NativeArray level but it looked more error prone.

Pull-Request: #1067
Reviewed-by: Jean Privat <jean@pryen.org>


Trivial merge