Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[System.IO.File]::ReadAllText slow on OSX #2548

Closed
TheAngryByrd opened this issue Sep 26, 2017 · 1 comment
Closed

[System.IO.File]::ReadAllText slow on OSX #2548

TheAngryByrd opened this issue Sep 26, 2017 · 1 comment
Labels

Comments

@TheAngryByrd
Copy link

[System.IO.File]::ReadAllText seems to be slow on OSX. Paket is using ReadAllText (due to the fact there isn't any built in hashing) to compare two files.

    <PropertyGroup Condition="Exists('$(PaketRestoreCacheFile)') ">
      <PaketRestoreCachedHash>$([System.IO.File]::ReadAllText('$(PaketRestoreCacheFile)'))</PaketRestoreCachedHash>
      <PaketRestoreLockFileHash>$([System.IO.File]::ReadAllText('$(PaketLockFilePath)'))</PaketRestoreLockFileHash>
      <PaketRestoreRequired>true</PaketRestoreRequired>
      <PaketRestoreRequired Condition=" '$(PaketRestoreLockFileHash)' == '$(PaketRestoreCachedHash)' ">false</PaketRestoreRequired>
      <PaketRestoreRequired Condition=" '$(PaketRestoreLockFileHash)' == '' ">true</PaketRestoreRequired>
    </PropertyGroup>

It's fairly speedy on windows but on osx it's this case almost 10 times longer:

Windows:

Target Performance Summary:
        0 ms  _GenerateRestoreGraphProjectEntry          1 calls
        0 ms  _IsProjectRestoreSupported                 1 calls
        0 ms  _GetRestoreSettingsOverrides               1 calls
        0 ms  _GetRestoreTargetFrameworksAsItems         1 calls
        0 ms  CheckForImplicitPackageReferenceOverridesBeforeRestore   2 calls
        0 ms  _GenerateProjectRestoreGraph               1 calls
        0 ms  _GetRestoreProjectStyle                    3 calls
        0 ms  _GetRestoreSettingsPerFramework            2 calls
        1 ms  _GenerateRestoreSpecs                      1 calls
        1 ms  _GetProjectJsonPath                        3 calls
        1 ms  _GenerateRestoreProjectSpec                1 calls
        1 ms  _GenerateRestoreProjectPathWalk            1 calls
        1 ms  _GenerateRestoreProjectPathItemsPerFramework   2 calls
        3 ms  _GetRestoreTargetFrameworksOutput          1 calls
        5 ms  _GenerateProjectRestoreGraphPerFramework   2 calls
       10 ms  GetAllRuntimeIdentifiers                   3 calls
       11 ms  _LoadRestoreGraphEntryPoints               1 calls
       12 ms  _GenerateDotnetCliToolReferenceSpecs       1 calls
       45 ms  _GetRestoreSettings                        1 calls
       99 ms  _FilterRestoreGraphProjectInputItems       1 calls
      200 ms  _GenerateRestoreProjectPathItems           1 calls
      222 ms  _GetAllRestoreProjectPathItems             1 calls
      223 ms  Restore                                    1 calls
      401 ms  _GenerateRestoreDependencies               1 calls
      527 ms  PaketRestore                               3 calls
      637 ms  _GenerateRestoreGraph                      1 calls

OSX:

Target Performance Summary:
        0 ms  CheckForImplicitPackageReferenceOverridesBeforeRestore   2 calls
        0 ms  _GenerateRestoreGraphProjectEntry          1 calls
        0 ms  _GetRestoreTargetFrameworksAsItems         1 calls
        0 ms  _GetRestoreProjectStyle                    3 calls
        0 ms  _GenerateProjectRestoreGraph               1 calls
        0 ms  _GetRestoreSettingsOverrides               1 calls
        1 ms  _IsProjectRestoreSupported                 1 calls
        1 ms  _GetRestoreSettingsPerFramework            2 calls
        1 ms  _GetProjectJsonPath                        3 calls
        1 ms  _GenerateRestoreProjectPathWalk            1 calls
        1 ms  _GenerateRestoreSpecs                      1 calls
        1 ms  _GenerateRestoreProjectPathItemsPerFramework   2 calls
        2 ms  _GenerateRestoreProjectSpec                1 calls
        3 ms  GetAllRuntimeIdentifiers                   3 calls
        4 ms  _GetRestoreTargetFrameworksOutput          1 calls
        9 ms  _GenerateProjectRestoreGraphPerFramework   2 calls
       10 ms  _GenerateDotnetCliToolReferenceSpecs       1 calls
       10 ms  _LoadRestoreGraphEntryPoints               1 calls
       21 ms  _GetRestoreSettings                        1 calls
      101 ms  _FilterRestoreGraphProjectInputItems       1 calls
      209 ms  _GenerateRestoreProjectPathItems           1 calls
      218 ms  _GetAllRestoreProjectPathItems             1 calls
     1142 ms  Restore                                    1 calls
     3948 ms  _GenerateRestoreDependencies               1 calls
     5779 ms  PaketRestore                               3 calls
     5841 ms  _GenerateRestoreGraph                      1 calls

Related: fsprojects/Paket#2796

@rainersigwald
Copy link
Member

Team triage: closing due to age. If you're still seeing this problem, please let us know and we can reactivate it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants