Skip to content

To improve performance, FileTypeMetadata.Exists() should use base Python rather than DataManagement.Files.File.Exists() #31

@jjrob

Description

@jjrob

In GeoEco.Logging, Logger.Initialize() is defined this way:

    @classmethod
    def Initialize(cls, activateArcGISLogging=False, loggingConfigFile=None):
        cls.__doc__.Obj.ValidateMethodInvocation()
        ...

Usually, Logging.Initialize() is called before most other MGET code is imported or invoked. It turns out that if a value is provided for loggingConfigFile, the function can take 15 seconds to complete.

The reason for that lengthy delay appears to be related to how much MGET code must be imported simply to validate the value of loggingConfigFile. Ultimately, this validation requires GeoEco.Types.FileTypeMetadata.Exists() to be called on the file. Rather than just using base Python functions (e.g. os.path.exists() and os.path.isfile()), FileTypeMetadata.Exists() imports GeoEco.DataManagement.Files and calls File.Exists(). Apparently this import and call is responsible for nearly all of the delay. The underlying reason for the delay is not currently known.

The delay needs to be fully investigated, but for now, FileTypeMetadata.Exists() should be changed to use base Python rather than File.Exists(). This will greatly speed up Logger.Initialize() and defer the delay to whatever code needs to make use of GeoEco.DataManagement.Files functions other than File.Exists().

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions