to uses snoc under the hood, which is O(n^2) - when building lots of geometry the CPU time is unacceptable, eg:
setGeometry $ vertices $ mapM to [ mkvert x y | x <- [0 .. dx], y <- [0 .. dy] ]
For big values of dx and dy It's much faster with something like:
let verts = [ mkvert x y
| x <- [0 .. dy]
, y <- [0 .. dx]
]
in setRawGeometry $ VUnboxed.singleton $ RawTriangles verts
Maybe this could be fixed by more use of addVertexList or something - but the whole point of the API is that it makes generating geometry easy and hopefully type safe, without necessarily having to dive into Vector.
Think up new wieldy ways of generating geometry that are also fast in CPU time.
to
usessnoc
under the hood, which is O(n^2) - when building lots of geometry the CPU time is unacceptable, eg:For big values of
dx
anddy
It's much faster with something like:Maybe this could be fixed by more use of
addVertexList
or something - but the whole point of the API is that it makes generating geometry easy and hopefully type safe, without necessarily having to dive intoVector
.Think up new wieldy ways of generating geometry that are also fast in CPU time.