Created
January 5, 2016 07:36
-
-
Save Jand42/4766d0b68eecd29ed3bb to your computer and use it in GitHub Desktop.
FCS compilation time testing
This file contains hidden or 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
| open System.Diagnostics | |
| open System.IO | |
| let ( +/ ) a b = Path.Combine(a, b) | |
| let fcsRepoDir = @"C:\repos\FSharp.Compiler.Service" // set to a folder with FCS built | |
| let fscExe = @"C:\Program Files (x86)\Microsoft SDKs\F#\4.0\Framework\v4.0\fsc.exe" | |
| let fsc40Exe = fcsRepoDir +/ @"bin\v4.0\FscExe.exe" | |
| let fsc45Exe = fcsRepoDir +/ @"bin\v4.5\FscExe.exe" | |
| let args = "" // set args for the project you would like to test | |
| System.Environment.CurrentDirectory <- "" // set to project directory | |
| let run exe message = | |
| printfn "%s" message | |
| let proc = | |
| let startInfo = | |
| ProcessStartInfo(exe, args, | |
| UseShellExecute = false, | |
| RedirectStandardOutput = true, | |
| RedirectStandardError = true, | |
| CreateNoWindow = true) | |
| new Process(StartInfo = startInfo) | |
| proc.OutputDataReceived.Add ignore | |
| proc.ErrorDataReceived.Add ignore | |
| proc.Start() |> ignore | |
| proc.BeginOutputReadLine() | |
| proc.BeginErrorReadLine() | |
| proc.WaitForExit() | |
| printfn "Running time: %A, Exit code: %d" (proc.ExitTime - proc.StartTime) proc.ExitCode | |
| printfn "Total processor time: %A" proc.TotalProcessorTime | |
| run fscExe "Building with original fsc" | |
| run fsc40Exe "Building with FCS 4.0" | |
| run fsc45Exe "Building with FCS 4.5" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment