How to improve the perfomance of a large rule tile based tilemap?

I have a big tilemap with 800x800 rule tiles. I could use normal tiles, but i want to use the rule tile feature for my map. Is there any way to improve the performance of my rule tile based tilemap?

A rule (nomen omen) of thumb would be to define the rules for tiles in an order reflecting the probability of their occurence, so that we skip as much cases to check as possible. For example, if you have large areas of grass, then it would make sense to define the rule for most common “inner tile” (with all neighbours being grass too) in the first place.

Actually I haven’t applied this approach to my current project and this question encouraged me to test it. So I have a 800x800 grid with a few tilemaps, having 1,2 mln tiles in total with around 0,5 mln of them being rule tiles with 48 rules. The rules were ordered kind of randomly with the most common inner tile rule being on 6th place of the rule list. It took 66 seconds for my quite good laptop to generate this tilemap.

After switching the inner tile rule to first place, I saved 10 seconds. Ordering the other rules properly would maybe give me another 10. Not very impressing, but that’s always something.