Here is the code:
const startTime = new Date().getTime(); const arr = []; for (let i = 0; i < 10000000; ++i) { arr.push(Math.random()); } console.log(new Date().getTime() - startTime); Is it possible to optimize it somehow? Now it runs for about 300ms. Tried to compile the source code of the nodejs itself. It did not help
Are there any other ways to accelerate?
P.S. Yes, the code looks meaningless. But it is he who needs to be optimized.
Math.random()- Stepan Kasyanenko