Skip to content

Removing Hardlink from Mode property in default file system format#8789

Merged
adityapatwardhan merged 33 commits intoPowerShell:masterfrom
powercode:Perf/Hardlink
Mar 12, 2019
Merged

Removing Hardlink from Mode property in default file system format#8789
adityapatwardhan merged 33 commits intoPowerShell:masterfrom
powercode:Perf/Hardlink

Conversation

@powercode
Copy link
Copy Markdown
Collaborator

@powercode powercode commented Jan 30, 2019

Adding a new table view, childrenWithHardlink, that has the same behavior as children view had before this PR.

The children view now uses the modified ModeWithoutHardlink property that doesn't check for hardlinks when setting the l letter of Mode column.

The Mode property keeps it's existing behavior, so this change should not be breaking.

PR Summary

#8051

Significant speedup for default filesystem output

$files = gci -Recurse c:\windows -ea:0
$files | ft | out-null
$files | ft -view childrenWithHardlink  | out-null
view time speedup
childrenWithHardlink 3m22s 1x
children 7.6s 26x

Formatting result

Output before

PS> gci

    Directory: D:\repos\PowerShell\symlinks


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----       2019-02-03     15:37                dir
d----l       2019-02-03     15:38                symdir
d----l       2019-02-03     15:39                symsubdir
-a----       2019-02-03     15:38              3 file
-a---l       2019-02-03     15:37              3 hardlink
-a---l       2019-02-03     15:38              0 symfile1

Output after

PS> gci

    Directory: D:\repos\PowerShell\symlinks

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d----         2019-02-03    15:37                dir
l----         2019-02-03    15:38                symdir -> D:\repos\PowerShell\symlinks\dir
l----         2019-02-03    15:39                symsubdir -> D:\repos\PowerShell\symlinks\dir\subdir\
-a---         2019-02-03    15:38              3 file
-a---         2019-02-03    15:37              3 hardlink
la---         2019-02-03    15:38              0 symfile1 -> D:\repos\PowerShell\file

PS> gci | ft -view childrenWithHardlink

    Directory: D:\repos\PowerShell\symlinks

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d----         2019-02-03    15:37                dir
l----         2019-02-03    15:38                symdir -> D:\repos\PowerShell\symlinks\dir
l----         2019-02-03    15:39                symsubdir -> D:\repos\PowerShell\symlinks\dir\subdir\
-a---         2019-02-03    15:38              3 file
la---         2019-02-03    15:37              3 hardlink
la---         2019-02-03    15:38              0 symfile1 -> D:\repos\PowerShell\file

produces the old output.

PR Context

PR Checklist

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log Committee-Reviewed PS-Committee has reviewed this and made a decision Documentation Needed in this repo Documentation is needed in this repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants