Performance improvement: the schema's are already unique by the algorithm in getImportedSchemas, and the unique comparison takes a lot of time.
Performance improvement: make sure the log message is not evaluated each time (all small changes in getImportedSchemas have a huge effect)
Performance improvement: caching type lookups in Schema
Performance improvement: caching the results of getAllSchemas(). This results in dramatic performance improvements for larger type trees build out of multiple schemas.