### Godot version

v4.1.stable.mono.official [970459615]

### System information

Godot v4.1.stable.mono - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1050 Ti (NVIDIA; 31.0.15.3179) - AMD Ryzen 3 3200G with Radeon Vega Graphics (4 Threads)

### Issue description

I have a scene with a large amount of InstanceMesh3D, StaticBody3D which are in a Map node. This scene does not cause any lags for me, but as soon as I expand the Map node, my scene starts to lag and it is impossible to work with the project at all. Before that I moved my project from 4.0.2.stable to 4.1.stable. The previous version did not cause such problems.

### Steps to reproduce

Create a scene of over +500 MeshInstance3D with any shape that is in a Node3D node. Try to open and close Node3D and you will see the performance drop.

### Minimal reproduction project

N/A
theme_cache.scroll_border = get_theme_constant(SNAME("scroll_border"));
	theme_cache.scroll_speed = get_theme_constant(SNAME("scroll_speed"));
	theme_cache.scrollbar_margin_top = get_theme_constant(SNAME("scrollbar_margin_top"));
	theme_cache.scrollbar_margin_right = get_theme_constant(SNAME("scrollbar_margin_right"));
	theme_cache.scrollbar_margin_bottom = get_theme_constant(SNAME("scrollbar_margin_bottom"));
	theme_cache.scrollbar_margin_left = get_theme_constant(SNAME("scrollbar_margin_left"));
	theme_cache.scrollbar_h_separation = get_theme_constant(SNAME("scrollbar_h_separation"));
	theme_cache.scrollbar_v_separation = get_theme_constant(SNAME("scrollbar_v_separation"));
	theme_cache.title_button = get_theme_stylebox(SNAME("title_button_normal"));
	theme_cache.title_button_pressed = get_theme_stylebox(SNAME("title_button_pressed"));
	theme_cache.title_button_hover = get_theme_stylebox(SNAME("title_button_hover"));
	theme_cache.title_button_color = get_theme_color(SNAME("title_button_color"));
	theme_cache.base_scale = get_theme_default_base_scale();
}
Size2 Tree::_get_cell_icon_size(const TreeItem::Cell &p_cell) const {
	Size2i icon_size = p_cell.get_icon_size();
	int max_width = 0;
	if (theme_cache.icon_max_width > 0) {
		max_width = theme_cache.icon_max_width;
	}
	if (p_cell.icon_max_w > 0 && (max_width == 0 || p_cell.icon_max_w < max_width)) {
		max_width = p_cell.icon_max_w;
	}
	if (max_width > 0 && icon_size.width > max_width) {
		icon_size.height = icon_size.height * max_width / icon_size.width;
		icon_size.width = max_width;
	}
	return icon_size;
}
int Tree::compute_item_height(TreeItem *p_item) const {