### 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
RID f;
	int fs = p_sd->spans[p_span].font_size;
	if (p_fb_index >= 0 && p_fb_index < p_fonts.size()) {
		
		f = p_fonts[p_fb_index];
	} else if (OS::get_singleton()->has_feature("system_fonts") && p_fonts.size() > 0 && ((p_fb_index == p_fonts.size()) || (p_fb_index > p_fonts.size() && p_start != p_prev_start))) {
		
		RID fdef = p_fonts[0];
		if (_font_is_allow_system_fallback(fdef)) {
			_update_chars(p_sd);
			int64_t next = p_end;
			for (const int32_t &E : p_sd->chars) {
				if (E > p_start) {
					next = E;
					
				}
			}
			String text = p_sd->text.substr(p_start, next - p_start);