### 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
ERR_FAIL_COND(p_cache_index < 0);
	_ensure_rid(p_cache_index);
	TS->font_set_transform(cache[p_cache_index], p_transform);
}
Transform2D FontFile::get_transform(int p_cache_index) const {
	ERR_FAIL_COND_V(p_cache_index < 0, Transform2D());
	_ensure_rid(p_cache_index);
	return TS->font_get_transform(cache[p_cache_index]);
}
void FontFile::set_extra_spacing(int p_cache_index, TextServer::SpacingType p_spacing, int64_t p_value) {
	ERR_FAIL_COND(p_cache_index < 0);
	_ensure_rid(p_cache_index);
	TS->font_set_spacing(cache[p_cache_index], p_spacing, p_value);
}
int64_t FontFile::get_extra_spacing(int p_cache_index, TextServer::SpacingType p_spacing) const {
	ERR_FAIL_COND_V(p_cache_index < 0, 0);
	_ensure_rid(p_cache_index);
	return TS->font_get_spacing(cache[p_cache_index], p_spacing);
}
void FontFile::set_face_index(int p_cache_index, int64_t p_index) {
	ERR_FAIL_COND(p_cache_index < 0);
	ERR_FAIL_COND(p_index < 0);
	ERR_FAIL_COND(p_index >= 0x7FFF);
	_ensure_rid(p_cache_index);
	TS->font_set_face_index(cache[p_cache_index], p_index);
}
int64_t FontFile::get_face_index(int p_cache_index) const {