SchemaBackend.importEntry() method compares the old definition and the new definition before deciding to save a schema element (AttributeType and ObjectClass). See SchemaBackend.hasDefinitionChanged() methods.
However, it is possible that the old definition does not have the X-SCHEMA-FILE attribute set, while the new has it. This results in superfluous writes.
In addition, SchemaBackend.writeTempSchemaFile() always writes the X-SCHEMA-FILE which is redundant with the file name where the schema entry is written.
For example, a schema element with X-SCHEMA-FILE '03-uddiv3.ldif' will be written to the file schema/03-uddiv3.ldif. It is a shame to write the schema file name in the schema file with that name.