When to use Float32Array instead of Array in JavaScript

后端 未结 3 1720
面向向阳花
面向向阳花 2020-12-12 22:18

When does it make sense to use a Float32Array instead of a standard JavaScript Array for browser applications?

This performance test shows

3条回答
  •  眼角桃花
    2020-12-12 22:29

    I would assume that the glMatrix library uses Float32Array because it is primarily used in WebGL-applications, where matrices are represented as Float32Arrays (http://www.khronos.org/registry/webgl/specs/1.0/#5.14.10).

提交回复
热议问题