### 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
ubidi_setPara(bidi_iter, data + start, end - start, sd->base_para_direction, nullptr, &err);
					}
				} 
			}
			if (U_FAILURE(err)) {
				ubidi_close(bidi_iter);
				bidi_iter = nullptr;
				ERR_PRINT(vformat("BiDi reordering for the paragraph failed: %s", u_errorName(err)));
			}
		} else {
			bidi_iter = nullptr;
			ERR_PRINT(vformat("BiDi iterator allocation for the paragraph failed: %s", u_errorName(err)));
		}
		sd->bidi_iter.push_back(bidi_iter);
		err = U_ZERO_ERROR;
		int bidi_run_count = 1;
		if (bidi_iter) {
			bidi_run_count = ubidi_countRuns(bidi_iter, &err);
			if (U_FAILURE(err)) {
				ERR_PRINT(u_errorName(err));
			}
		}
		for (int i = 0; i < bidi_run_count; i++) {
			int32_t _bidi_run_start = 0;
			int32_t _bidi_run_length = end - start;
			bool is_rtl = false;
			hb_direction_t bidi_run_direction = HB_DIRECTION_INVALID;
			if (bidi_iter) {
				is_rtl = (ubidi_getVisualRun(bidi_iter, i, &_bidi_run_start, &_bidi_run_length) == UBIDI_LTR);
			}