### 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 (int j = r_start; j < r_end; j++) {
					char32_t c = sd->text[j - sd->start];
					if (is_whitespace(c)) {
						sd->breaks[j + 1] = false;
					}
					if (is_linebreak(c)) {
						sd->breaks[j + 1] = true;
					}
				}
			} else {
				while (ubrk_next(bi) != UBRK_DONE) {
					int pos = _convert_pos(sd, ubrk_current(bi)) + r_start;
					if ((ubrk_getRuleStatus(bi) >= UBRK_LINE_HARD) && (ubrk_getRuleStatus(bi) < UBRK_LINE_HARD_LIMIT)) {
						sd->breaks[pos] = true;
					} else if ((ubrk_getRuleStatus(bi) >= UBRK_LINE_SOFT) && (ubrk_getRuleStatus(bi) < UBRK_LINE_SOFT_LIMIT)) {
						sd->breaks[pos] = false;
					}
					int pos_p = pos - 1 - sd->start;
					char32_t c = sd->text[pos_p];
					if (pos - sd->start != sd->end && !is_whitespace(c) && (c != 0xfffc)) {
						sd->break_inserts++;
					}
				}
			}
			ubrk_close(bi);
			i++;
		}
		sd->break_ops_valid = true;
	}
	Vector<Glyph> glyphs_new;