{"action":"created","issue":{"url":"https://api.github.com/repos/PowerShell/PowerShell/issues/7238","repository_url":"https://api.github.com/repos/PowerShell/PowerShell","labels_url":"https://api.github.com/repos/PowerShell/PowerShell/issues/7238/labels{/name}","comments_url":"https://api.github.com/repos/PowerShell/PowerShell/issues/7238/comments","events_url":"https://api.github.com/repos/PowerShell/PowerShell/issues/7238/events","html_url":"https://github.com/PowerShell/PowerShell/issues/7238","id":338829704,"node_id":"MDU6SXNzdWUzMzg4Mjk3MDQ=","number":7238,"title":"PowerShell Core 6.0.2 is slow with Get-ChildItem","user":{"login":"chojrak11","id":15248889,"node_id":"MDQ6VXNlcjE1MjQ4ODg5","avatar_url":"https://avatars2.githubusercontent.com/u/15248889?v=4","gravatar_id":"","url":"https://api.github.com/users/chojrak11","html_url":"https://github.com/chojrak11","followers_url":"https://api.github.com/users/chojrak11/followers","following_url":"https://api.github.com/users/chojrak11/following{/other_user}","gists_url":"https://api.github.com/users/chojrak11/gists{/gist_id}","starred_url":"https://api.github.com/users/chojrak11/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chojrak11/subscriptions","organizations_url":"https://api.github.com/users/chojrak11/orgs","repos_url":"https://api.github.com/users/chojrak11/repos","events_url":"https://api.github.com/users/chojrak11/events{/privacy}","received_events_url":"https://api.github.com/users/chojrak11/received_events","type":"User","site_admin":false},"labels":[{"id":401720900,"node_id":"MDU6TGFiZWw0MDE3MjA5MDA=","url":"https://api.github.com/repos/PowerShell/PowerShell/labels/Area-Performance","name":"Area-Performance","color":"5319e7","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-07-06T07:10:22Z","updated_at":"2018-07-06T14:13:13Z","closed_at":null,"author_association":"NONE","body":"The following command takes more than 2 times as long in PowerShell Core than in Windows PowerShell. I don't see the reason for this huge difference on the same OS instance (Windows 10). I repeated the test several times and these results are on hot filesystem cache (no actual I/O). During the tests in both PowerShell versions I observed the same CPU load (around 18% on a 4-core 8-thread i7 system).\r\n\r\n```powershell\r\nSet-Location $ENV:UserProfile\r\nMeasure-Command { Get-ChildItem -Recurse | Measure-Object }\r\n```\r\n\r\nOutput in PowerShell Core on my profile folder (153000 files):\r\n\r\n```none\r\n(...)\r\nTotalSeconds      : 22,439892\r\nTotalMilliseconds : 22439,892\r\n```\r\n\r\nOutput in Windows PowerShell on the same folder:\r\n\r\n```none\r\n(...)\r\nTotalSeconds      : 10,8080086\r\nTotalMilliseconds : 10808,0086\r\n```\r\n\r\nEnvironment data\r\n----------------\r\n\r\n$PSVersionTable:\r\n\r\n```none\r\nName                           Value\r\n----                           -----\r\nPSVersion                      6.0.2\r\nPSEdition                      Core\r\nGitCommitId                    v6.0.2\r\nOS                             Microsoft Windows 10.0.17134\r\nPlatform                       Win32NT\r\nPSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}\r\nPSRemotingProtocolVersion      2.3\r\nSerializationVersion           1.1.0.1\r\nWSManStackVersion              3.0\r\n```\r\n\r\n```none\r\nName                           Value\r\n----                           -----\r\nPSVersion                      5.1.17134.137\r\nPSEdition                      Desktop\r\nPSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}\r\nBuildVersion                   10.0.17134.137\r\nCLRVersion                     4.0.30319.42000\r\nWSManStackVersion              3.0\r\nPSRemotingProtocolVersion      2.3\r\nSerializationVersion           1.1.0.1\r\n```"},"comment":{"url":"https://api.github.com/repos/PowerShell/PowerShell/issues/comments/403046398","html_url":"https://github.com/PowerShell/PowerShell/issues/7238#issuecomment-403046398","issue_url":"https://api.github.com/repos/PowerShell/PowerShell/issues/7238","id":403046398,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMzA0NjM5OA==","user":{"login":"chojrak11","id":15248889,"node_id":"MDQ6VXNlcjE1MjQ4ODg5","avatar_url":"https://avatars2.githubusercontent.com/u/15248889?v=4","gravatar_id":"","url":"https://api.github.com/users/chojrak11","html_url":"https://github.com/chojrak11","followers_url":"https://api.github.com/users/chojrak11/followers","following_url":"https://api.github.com/users/chojrak11/following{/other_user}","gists_url":"https://api.github.com/users/chojrak11/gists{/gist_id}","starred_url":"https://api.github.com/users/chojrak11/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chojrak11/subscriptions","organizations_url":"https://api.github.com/users/chojrak11/orgs","repos_url":"https://api.github.com/users/chojrak11/repos","events_url":"https://api.github.com/users/chojrak11/events{/privacy}","received_events_url":"https://api.github.com/users/chojrak11/received_events","type":"User","site_admin":false},"created_at":"2018-07-06T14:13:13Z","updated_at":"2018-07-06T14:13:13Z","author_association":"NONE","body":"I repeated the test several times (as noted above), but here you go, as you requested, the results of your command. To be clear, they were executed sequentially, not simultaneously:\r\n\r\nWindows PowerShell:\r\n\r\n```none\r\n\r\nPS C:\\> 1..10 |\r\n>>     ForEach-Object { Measure-Command { Get-ChildItem -Recurse -Path $HOME } } |\r\n>>     Measure-Object TotalSeconds -Average\r\n\r\nCount    : 10\r\nAverage  : 9,5322764\r\nSum      :\r\nMaximum  :\r\nMinimum  :\r\nProperty : TotalSeconds\r\n```\r\n\r\nPowerShell Core 6.0.2:\r\n\r\n```none\r\nPS C:\\Program Files\\PowerShell\\6.0.2> 1..10 |\r\n>>     ForEach-Object { Measure-Command { Get-ChildItem -Recurse -Path $HOME } } |\r\n>>     Measure-Object TotalSeconds -Average\r\n\r\nCount    : 10\r\nAverage  : 19,21532841\r\nSum      :\r\nMaximum  :\r\nMinimum  :\r\nProperty : TotalSeconds\r\n```\r\n\r\nThat's almost exactly twice as long.\r\nI don't have any idea where to start looking for the problem, hope there are wise people here who can explain (and fix) this.\r\n\r\nIf your results are not as prominent, please select a bigger folder for the test, e.g. Program Files or Windows.\r\n"}}
{"actor":{"display_login":"chojrak11"}}