If the design of your roguelike limits player vision so they only see their surroundings, then instead of generating the 512 x 512 map in one go, you can improve the performance/memory usage by generating only the blocks around the player.
This would save a lot of initial loading time and could support maps much larger than 512 x 512.
If your engine doesn't need to render objects outside the viewport, then you don't need to generate those objects until you actually need to render it.
This would save a lot of initial loading time and could support maps much larger than 512 x 512.