supereggbert / GLGE

A javascript webGL graphics library
http://glge.org
Other
394 stars 84 forks source link

Optimized Wavefront loader & Mesh.calcTangents #70

Closed letmaik closed 12 years ago

letmaik commented 12 years ago

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.

supereggbert commented 12 years ago

I should have done that ages ago, thanks loads :-)