Do you use a array for the random generating.
If so you can set a Global Variable with in it, the array "as json".
Then you can carry that info over to the next level.
So at the new level you can load the random level instantly by loading the variable back into the array as json.
Then do your optimizing stuff and your set.