### 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
return variation.transform;
}
void FontVariation::set_variation_face_index(int p_face_index) {
	if (variation.face_index != p_face_index) {
		variation.face_index = p_face_index;
		_invalidate_rids();
	}
}
int FontVariation::get_variation_face_index() const {
	return variation.face_index;
}
void FontVariation::set_opentype_features(const Dictionary &p_features) {
	opentype_features = p_features;
	_invalidate_rids();
}
Dictionary FontVariation::get_opentype_features() const {
	return opentype_features;
}
void FontVariation::set_spacing(TextServer::SpacingType p_spacing, int p_value) {
	ERR_FAIL_INDEX((int)p_spacing, TextServer::SPACING_MAX);
	if (extra_spacing[p_spacing] != p_value) {
		extra_spacing[p_spacing] = p_value;
		_invalidate_rids();
	}
}
int FontVariation::get_spacing(TextServer::SpacingType p_spacing) const {