Created
April 12, 2014 22:12
-
-
Save haraldfianbakken/10559398 to your computer and use it in GitHub Desktop.
Powershell performance on huge files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$method1 = [scriptblock]{ | |
gc Data\SwissProt.xml, Data\SwissProt.xml|Set-Content -Path Output.xml | |
} | |
$method2 = [scriptblock]{ | |
gc -ReadCount 512 Data\SwissProt.xml, Data\SwissProt.xml|Set-Content -Path Output2.xml; | |
} | |
#Measure-Command -Expression $method1; | |
<# | |
Days : 0 | |
Hours : 0 | |
Minutes : 3 | |
Seconds : 42 | |
Milliseconds : 713 | |
Ticks : 2227133416 | |
TotalDays : 0,00257770071296296 | |
TotalHours : 0,0618648171111111 | |
TotalMinutes : 3,71188902666667 | |
TotalSeconds : 222,7133416 | |
TotalMilliseconds : 222713,3416 | |
#> | |
Measure-Command -Expression $method2; | |
<# | |
Days : 0 | |
Hours : 0 | |
Minutes : 0 | |
Seconds : 4 | |
Milliseconds : 983 | |
Ticks : 49839060 | |
TotalDays : 5,76840972222222E-05 | |
TotalHours : 0,00138441833333333 | |
TotalMinutes : 0,0830651 | |
TotalSeconds : 4,983906 | |
TotalMilliseconds : 4983,906 | |
#> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment