Sabitlenmiş Tweet
FatherJack 〓〓
36.6K posts

FatherJack 〓〓
@fatherjack
Database Engineer SQLSouthWest user group leader - https://t.co/jSeLLz4J1c, Blogger - https://t.co/s8LszyOkJO...
Cornwall, Devon, Southampton Katılım Mart 2008
1.1K Takip Edilen1.9K Takipçiler

@IISResetMe Ok good to know. I'm just wondering if there is enough gain to go to effort to swap to .net. might have an experiment to see. Thx
English

@fatherjack Depends on your strategy for reading the file contents. If you attempt to read the entire file into memory at once before calculating the hash then Get-FileHash probably wins that race 🙃
English

@IISResetMe would you expect .net method to create md5 hash of files to be faster than get-filehash please?
English
FatherJack 〓〓 retweetledi

Fascinating career story of someone I wish I'd known about sooner techcrunch.com/2023/08/04/win…
thank you @window
English

@fatherjack @sql_williamd Careful - the sides have fallen off !!
English

@sql_williamd just in case the Tesla is getting boring .. .. .. autotrader.co.uk/car-details/20…
English


@sql_williamd It was all Boulogne in my day. We did visit La Rochelle several years ago in the Golf though. Had a lovely week. Hope you enjoy it
English

@fatherjack This way you avoid having PowerShell recursively traverse the tree, might help with time to first copy
English

Who or what is a good resource for the way Get-Childitem and [system.io.directory] work at scale (millions of files) please? #powershell
English

@IISResetMe I have been called in as the logic needed in the copy process can't be implemented with RoboCopy
English

@fatherjack Another option is to use robocopy or xcopy - they'll use the OS APIs directly, so you avoid the overhead from the .NET/PowerShell abstractions above
English

@IISResetMe Ok. That's it for sure! No filters at the moment, we are taking everything..
Is the order of enumeration the same between executions?
Is there any sort of caching going on?
English

@fatherjack The file system will take longer initialising the iterator if the directory index is huge. Another slowdown might occur in the provider layer if you use -Include/-Exlude, especially in combination with -Depth/-Recurse
English

@IISResetMe So that's interesting as we see Get-Childitem path\millionsofdirctories |copy-item we are seeing a big lag before items start copying. Like it is parsing the whole dir of millions.
Scenario is very shallow and wide :
Dir\millionssubdir\files
English

@fatherjack By using iterators (or enumerators as they're called in .NET land), PowerShell avoids having to find _all the files_ up front - so if you do something like:
Get-ChildItem path\with\million\dirs -Directory |Select -First 1
You don't actually have to wait for the FS to return all
English

@ryanyates1990 Appreciate difference in speed, am wanting to know the way things work internally to explain observed outcomes
English

@fatherjack Dotnet methods almost always quicker than cmdlets, which under the hood will also call those methods
What version PowerShell are you on as for that scale you'd likely be best with a fanout approach for whatever task you want to complete
English
FatherJack 〓〓 retweetledi

Photo of the Day: Crowds at the #ArmedForcesDay event at Falmouth Airport queue for guided tours of the A380 Stealth Bomber. Tickets can be purchased through the website (see pinned tweet) for just £800.85 per person)
Photographed from a Canberra

English
FatherJack 〓〓 retweetledi
FatherJack 〓〓 retweetledi
FatherJack 〓〓 retweetledi
FatherJack 〓〓 retweetledi

If you didn't know the videos from #SQLBits2023 are on Canapii, our virtual platform!🧡
Be sure to enjoy and recap everything you learned (or missed!) at #SQLBits!👏

English










