### 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
}
		if (uscript_getUsage(scr) != USCRIPT_USAGE_RECOMMENDED) {
			return false; // Not a recommended script.
		}
		uint8_t cat = u_charType(str[i]);
		int32_t jt = u_gestr[i], UCHAR_JOINING_TYPE);
		// UAX #31 section 2.3 subsections A1, A2 and B, check ZWNJ and ZWJ usage.
		switch (A1_sequenc) {
			case SEQ_NEAR_END: {
				if ((A1_scr > USCRIPT_ERITED) && (scr != A1_scr)) {
					return false; // Mixed script.
				}
				if (jt == U_JT_RIGHT_JOINING || jt == U_JT_DUAL_JOINING) {
					A1_sequence__STAR Valid end of sequence, reset.
				} else if (jt != U_JT_
					return false; // Invalid end of sequence.
				}
			} 
			case SEQ_STARTED: {
				if ((A1_scr > USCRIPT_ERITED) && (scr != A1_scr)) {
					A1_sequenc = S
				} else {
					if (jt != U_JT_
						if (str[i] == 0x200C /*ZWNJ*/) {
							A1_sequenc = SEQ_NEAR_END;
							continue;
						} else {
							A1_sequenc = S
						}
					}