Variant 2 should not trigger any GC as there is no array creation: it simply takes your data and update the buffer directly.
_generatePointsArray is called only if the internal _positions is not constructed yet, and it should normally be constructed once except if you change the vertex array (as in variant 1).
public _generatePointsArray(): boolean {
if (this._positions) {
return true;
}
var data = this.getVerticesData(VertexBuffer.PositionKind);
if (!data || data.length === 0) {
return false;
}
this._positions = [];
for (var index = 0; index < data.length; index += 3) {
this._positions.push(Vector3.FromArray(data, index));
}
return true;
}
Anyway, you can use updateVerticesDataDirectly to avoid _generatePointsArray being called when updating the positions (of course, the collision code may not work as expected anymore as it will not used the updated position data…).
Let’s see if the post you linked to about the PR will get some attention.