How to optimize this procedurall generated 2d platformer made with threejs?

Use a WebWorker or some background task.