Tris memory optimization