About batch drawing of tile_map_layer nodes

Godot Version

Replace this line with your Godot version 4.6.2

Question

How to batch draw tiles for the tile_map_layer node, I avoid calling the set_cell() method for each tile by implementing the array required for the tile_map_data attribute in the node’s scene file. I want to know if this is correct and efficient, as the terrain generation system is programmatically generated in blocks

func _ready() -> void:
    print("hello world")