Skip to content

Performance Issues #1

@mukaschultze

Description

@mukaschultze

Line

if (DateTime.Now.Subtract(lastBackupTime).Ticks > backupTimeSpan.Ticks && CanBackup() && autoBackup)

Stack

Backup.CanBackup() ->
FastZip.isSupported ->
FastZip.path ->
AssetDatabase.FindAssets(string path) // Slowwww!!!!

Fix

Easy fix

Change the order of evaluation to && autoBackup && CanBackup(), so the CanBackup is only called when autobackup is true.

Correct fix

Cache the results of FastZip.isSupported and FastZip.path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions