Optimize handling of entity runtime clauses during file compilation and entity dynamic creation