### Godot version

8449592d92eaeef990f5502b419d491ee3eeb7a6

### System information

Windows 11

### Issue description

Zooming in the script editor on an empty script freezes the entire editor for a few seconds, but if the file is large then it freezes for 4-5 seconds (which is unacceptable). Looks like a recent regression.

### Steps to reproduce

Just zoom in/out on the large script file.

### Minimal reproduction project

N/A
for (unsigned int j = last_cluster_index; j < i; j++) {
						w[j].end = glyph_info[i].cluster;
					}
				}
				if (p_direction == HB_DIRECTION_RTL || p_direction == HB_DIRECTION_BTT) {
					w[last_cluster_index].flags |= GRAPHEME_IS_RTL;
				}
				if (last_cluster_valid) {
					w[last_cluster_index].flags |= GRAPHEME_IS_VALID;
				}
				w[last_cluster_index].count = i - last_cluster_index;
				last_cluster_index = i;
				last_cluster_valid = true;
			}
			last_cluster_id = glyph_info[i].cluster;
			Glyph &gl = w[i];
			gl = Glyph();
			gl.start = glyph_info[i].cluster;
			gl.end = end;
			gl.count = 0;
			gl.font_rid = f;
			gl.font_size = fs;
			if (glyph_info[i].mask & HB_GLYPH_FLAG_UNSAFE_TO_BREAK) {
				gl.flags |= GRAPHEME_IS_CONNECTED;
			}
#if HB_VERSION_ATLEAST(5, 1, 0)
			if (glyph_info[i].mask & HB_GLYPH_FLAG_SAFE_TO_INSERT_TATWEEL) {
				gl.flags |= GRAPHEME_IS_SAFE_TO_INSERT_TATWEEL;
			}
#endif