Closed nickdesaulniers closed 9 years ago
I figured you were right about the new strings being made, but I decided to run some benchmarks on this anyway and the regex is actually slower. I ran Mesh()
with a 100MB OBJ of a cube with 9 million faces and the suzanne.obj
in development/models
directory. The following is results:
And with some of the other optimizations you've contributed:
After playing around with your regex changes some more, it wasn't the regex that was slowing it down, it was the pre-indexing in the face section. The only thing I can think of is that a bunch of cache misses are occurring. I've added the regex back in as it still had a slight increase in speed: 556f0b5a.
this depends on #7 . Not strictly necessary. No performance numbers to compare before/after. Should be tested with large working example, but looked good to me.