The repeated use of indexOf() for the idxData array in the Wavefront loader was slowing down parsing a lot. I added a map so that O(1) lookups can be used. It is especially noticeable for larger Wavefront files. The mesh loading still took too long because of calcTangents. Some simple optimizations yielded a 3x speed-up. My test file was 8 MiB and in total I could achieve a speed up from >10 minutes to 8 seconds.
The repeated use of indexOf() for the idxData array in the Wavefront loader was slowing down parsing a lot. I added a map so that O(1) lookups can be used. It is especially noticeable for larger Wavefront files. The mesh loading still took too long because of calcTangents. Some simple optimizations yielded a 3x speed-up. My test file was 8 MiB and in total I could achieve a speed up from >10 minutes to 8 seconds.