Dealing with mass tree spawning

So I have a terrain mesh being generated through a series of scripts, it is infinite and works well for what it. The problem lies when adding trees, at first I tried making them spawn on only on a certain colour (green being grass) but to no success, next, I tried making them spawn then drawing a raycast down from each tree and moving them to that position but again to no success. Finally, I decided to spawn them above when the terrain would spawn and then using Ridgidbody.gravity to make them drop and freezing them at the position the hit which works, along side collision detection for if the collide with say a mountain or each other. This system works but as you would imagine have 1000+ trees spawning and falling for 1 seconds is quite laggy and takes about 5 seconds to balance out.

My question is could anyone think of a better way to do this.

Thanks

Add a physics raycaster component to the ground, spawn a tree at a height you know there is no terrain, cast a ray from the bottom of the tree (I guess the root) and calculate the distance from the ground, transform.translating the tree over that distance. Don’t load all trees at once but try loading around 10 or so trees per frame (work out what seems to work in a way it doesn’t kill frames).

Always avoid the combination of physics + a lot of objects unless you’ll have time to render that kind of simulation.