-
Notifications
You must be signed in to change notification settings - Fork 789
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CompilerPerf] Faster name resolution #1514
Conversation
@dotnet-bot tet this please |
760d1f5
to
075d563
Compare
ready for review/merge |
FSharp.Core.Unittests.FSharp_Core.Microsoft_FSharp_Control.AsyncModule.AwaitWaitHandle.Timeout seems unrelated!? @eiriktsarpalis do you know this thingy? |
9125789
to
c1e4faa
Compare
Ok I tried to test this. I wrote a batch file that runs fsc.exe in a loop on paket.core. For 20 times compiling (stopping after type check) I see:
|
It'd be interesting to see numbers for the whole pipeline, including creating binaries. |
So other words: we would save about 0.5s (about 5%) for a Paket.Core compile with a Am 03.09.2016 4:31 nachm. schrieb "Vasily Kirichenko" < It'd be interesting to see numbers for the whole pipeline, including — |
@forki I cannot reporduce your numbers on compiling Paket.Core. I have 8:38..8:40 on FSC master and 8:48..8:50 on your branch. "d:\github\visualfsharp\release\net40\bin\fsc.exe" -o:obj\Release\Paket.Core.dll -g --debug:pdbonly --noframework --define:TRACE --doc:....\bin\Paket.Core.XML --optimize+ -r:D:\github\Paket\packages\Chessie\lib\net40\Chessie.dll -r:D:\github\Paket\packages\FSharp.Core\lib\net40\FSharp.Core.dll -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\mscorlib.dll" -r:D:\github\Paket\packages\Newtonsoft.Json\lib\net45\Newtonsoft.Json.dll -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\System.Core.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\System.Data.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\System.Data.Linq.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\System.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\System.IO.Compression.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\System.IO.Compression.FileSystem.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\System.Numerics.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\System.Security.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\System.Xml.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\System.Xml.Linq.dll" --target:library --warn:3 --warnaserror:76 --vserrors --LCID:1033 --utf8output --fullpaths --flaterrors --subsystemversion:6.00 --highentropyva+ --sqmsessionguid:2e049b54-00aa-46a6-9620-996101adfb80 "C:\Users\kot\AppData\Local\Temp.NETFramework,Version=v4.5.AssemblyAttributes.fs" ....\paket-files\fsharp\FSharp.Data\src\CommonProviderImplementation\AssemblyReader.fs ....\paket-files\fsharp\FAKE\src\app\FakeLib\Globbing\Globbing.fs Async.fs AssemblyInfo.fs CustomAssemblyInfo.fs Domain.fs Constants.fs SemVer.fs VersionRange.fs Logging.fsi Logging.fs Xml.fs Utils.fs ConfigFile.fs PackageSources.fs FrameworkHandling.fs PlatformMatching.fs Requirements.fs ModuleResolver.fs RemoteDownload.fs RemoteUpload.fs PackageResolver.fs Nuspec.fs InstallModel.fs ReferencesFile.fs ProjectFile.fs SolutionFile.fs Nuget.fs NuGetV3.fs NuGetV2.fs DependenciesFile.fs DependencyModel.fs LockFile.fs DependencyChangeDetection.fs RestoreProcess.fs BindingRedirects.fs TemplateFile.fs NupkgWriter.fs ProcessOptions.fs PackagesConfigFile.fs InstallProcess.fs UpdateProcess.fs RemoveProcess.fs AddProcess.fs PackageMetaData.fs PackageProcess.fs Environment.fs Releases.fs Simplifier.fs VSIntegration.fs NugetConvert.fs FindOutdated.fs FindReferences.fs PublicAPI.fs |
What about compiling the compiler, how much does that save? |
So in other words: your test says I made it slower? Am 03.09.2016 21:14 schrieb "Dave Thomas" notifications@github.com:
|
10 full compile runs of Paket.Core:
but it has lot of variance so I think this not a good metric |
@7sharp9 same here no idea how to call fsc.exe to compile fsc.exe - this is now fully hidden in magic |
What about a ps/fake script which:
|
yes that sounds like good idea. I will try to write that today. Which projects could we use? |
Paket, FAKE, all of mbrace repos, fsharp.data, fsharpx.xxx, FCS (if it's possible to build it without DNC magic), F# Lint, all the popular TPs, like SqlClient, Swagger, AzureStorage. I think it's not very important what you choose. |
So build.cmd is now obsolete, having an easily buildable compiler is the most important thing. |
@7sharp9 what? |
so here we go: https://github.com/fsprojects/FSharpPerf |
the 1bf329f is this PR So there is improvement. Next step: make FSharpPerf run on a CI. |
great stuff |
with --typecheckonly flag on appveyor (see https://github.com/fsprojects/FSharpPerf/pull/5/files):
|
It would be great if shows improvement in percents, like this:
|
// Lookup: datatype constructors take precedence | ||
match unionCaseSearch with | ||
| Some ucase -> | ||
success(resInfo,Item.UnionCase(ucase,false),rest) | ||
| None -> | ||
let isLookUpExpr = match lookupKind with LookupKind.Expr -> true | _ -> false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice
1bf329f
to
868c516
Compare
@KevinRansom I think it should be merged together with #1512 since that one fixes the original bug. |
// Lookup: datatype constructors take precedence | ||
match unionCaseSearch with | ||
| Some ucase -> | ||
success(resInfo,Item.UnionCase(ucase,false),rest) | ||
| None -> | ||
let isLookUpExpr = lookupKind = LookupKind.Expr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use parentheses here
let isLookUpExpr = (lookupKind = LookupKind.Expr)
Looks like nuget package restore is failing?
|
I took a look at the code and it all looks good. |
@forki I'm a little sceptical about the use of AppVeyor timings - do you have any timings from a dedicated machine? Or do we know if our AppVeyor runs are on the same dedicated, real, stable, physical, not-virtual, not-being-used-for-anything-else machine? |
Tbh I'm sceptical about the whole approach. Am 20.09.2016 19:34 schrieb "Don Syme" notifications@github.com:
|
@dotnet-bot test this please |
Inspired by #1512 I optimized similar cases. This should bring faster name resolution