I am using leaflet to visualize several layers in the project. One layer(load from geojson format) contains thousands of small polygons, which has a very slow loading speed. I read this Visualizing large datasets with Leaflet, but it mainly deals with the markers. Is there a similar way to deal with polygon?
Firstly, check out this post. It may not be exactly what you want though, which is why I did not mark this thread for closure as a duplicate.
Secondly, there are a number of tactics you can employ in addition to the ones mentioned in the post. Simplifying the polygons can help to start with. Also, do you need to present the data as GeoJson? If not, then you could host it on a GeoServer instance and serve it as WMS. If you do need geoJSON, then you could consider hosting the data on Geoserver (or similar) and serve it as WFS but use bounding box requests to limit the amount of data pulled by the client.
If setting up Geoserver just for one dataset sounds like a sledgehammer to crack a nut, remember that Geoserver is very easy to set up and the time spent getting a basic instance up and running will probably be less than the effort to solve your huge GeoJson woes.
Thirdly, you can cut your GeoJson file in multiple files and only load the ones which are necessary depending on the view (unloading the others as you go)