It was painstaking optimization, try studying "Occlusion Culling". It was one of the most helpful ones; it renders only those visible by the camera. Also try studying baking lightmaps!