| ▲ | lern_too_spel 2 hours ago | ||||||||||||||||
You're describing array of structs vs. struct of arrays. Even in JavaScript, you would have to manually do the latter. | |||||||||||||||||
| ▲ | kykat 2 hours ago | parent [-] | ||||||||||||||||
V8 automatically optimizes objects with the same shape into efficient structs, making array of objects much more efficient than in Java. And the manually manager int array acts more like system memory, it's not continuous, so you could have point i 0 and 2 and the data would be: [1, 2, 3, x, x,x, 3, 2, 1] (3D points). So I am not describing a struct of arrays. | |||||||||||||||||
| |||||||||||||||||