@@ -14,9 +14,28 @@ Push-Location $PSScriptRoot
1414if ($env: GITHUB_WORKFLOW ) {
1515 $null = sudo npm install - g ' @11ty/eleventy'
1616}
17-
1817# endregion Install Prereqs
1918
19+ # region Get Clock Speed
20+ $cpuSpeed =
21+ if ($executionContext.SessionState.PSVariable.Get (' IsLinux' ).Value) {
22+ Get-Content / proc/ cpuinfo - Raw - ErrorAction SilentlyContinue |
23+ Select-String " (?<Unit>Mhz|MIPS)\s+\:\s+(?<Value>[\d\.]+)" |
24+ Select-Object - First 1 - ExpandProperty Matches |
25+ ForEach-Object {
26+ $_.Groups [" Value" ].Value -as [int ]
27+ }
28+ } elseif ($executionContext.SessionState.PSVariable.Get (' IsMacOS' ).Value) {
29+ (sysctl - n hw.cpufrequency) / 1e6 -as [int ]
30+ } else {
31+ $getCimInstance = $ExecutionContext.SessionState.InvokeCommand.GetCommand (' Get-CimInstance' , ' Cmdlet' )
32+ if ($getCimInstance ) {
33+ & $getCimInstance - Class Win32_Processor |
34+ Select-Object - ExpandProperty MaxClockSpeed
35+ }
36+ }
37+ # endregion
38+
2039$mySelf = $MyInvocation.MyCommand.ScriptBlock
2140
2241& {
@@ -52,15 +71,19 @@ $buildTimes | ConvertTo-Html -Title BuildTimes > ./times.html
5271 body { height: 100vh; max-width: 100vw; margin:0 }
5372
5473 svg { height: 5%; }
55- summary { font-size: 2rem; }
74+ h1,h2, h3 { text-align: center; }
75+ .techniqueSummary { font-size: 2rem; }
5676
5777 "
5878 " </style>"
5979 " </head>"
6080 " <body>"
81+ " <h1>4kb Markdown Files Benchmark</h1>"
82+ " <h2>Time to build 4096 markdown files</h2>"
83+ " <h3>Last built at $ ( [DateTime ]::UtcNow.ToString(" s" )) running @ $cpuSpeed Mhz</h3>"
6184 foreach ($buildTime in $buildTimes ) {
6285 " <details open>"
63- " <summary>$ ( $buildTime.Technique ) ($ ( [Math ]::Round(
86+ " <summary class='techniqueSummary' >$ ( $buildTime.Technique ) ($ ( [Math ]::Round(
6487 $buildTime.Time.TotalSeconds , 2
6588 )) s)</summary>"
6689 " <details>"
0 commit comments