### 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
}
			} else {
				for (int j = 0; j < c_punct_size; j++) {
					if (c_punct[j] == c) {
						sd_glyphs[i].flags |= GRAPHEME_IS_PUNCTUATION;
						break;
					}
				}
			}
			if (is_underscore(c)) {
				sd->glyphs.write[i].flags |= GRAPHEME_IS_UNDERSCORE;
			}
			if (is_whitespace(c) && !is_linebreak(c)) {
				sd_glyphs[i].flags |= GRAPHEME_IS_SPACE;
				sd_glyphs[i].flags |= GRAPHEME_IS_BREAK_SOFT;
			}
			if (is_linebreak(c)) {
				sd_glyphs[i].flags |= GRAPHEME_IS_SPACE;
				sd_glyphs[i].flags |= GRAPHEME_IS_BREAK_HARD;
			}
			if (c == 0x0009 || c == 0x000b) {
				sd_glyphs[i].flags |= GRAPHEME_IS_TAB;
			}
			i += (sd_glyphs[i].count - 1);
		}
	}
	sd->line_breaks_valid = true;
	return sd->line_breaks_valid;
}
bool TextServerFallback::_shaped_text_update_justification_ops(const RID &p_shaped) {