Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit556b64c

Browse files
authored
Cherry pick benchmarking (dotnet#6018)
* Initial benchmarking* Removing unused files* Fixing path* Updated for dev16* Finished cherry-pick
1 parentf718c06 commit556b64c

File tree

3 files changed

+125
-0
lines changed

3 files changed

+125
-0
lines changed

‎benchmarks/Benchmarks.sln‎

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 16
4+
VisualStudioVersion =16.0.28407.52
5+
MinimumVisualStudioVersion =10.0.40219.1
6+
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") ="CompilerServiceBenchmarks","CompilerServiceBenchmarks\CompilerServiceBenchmarks.fsproj","{9A3C565C-B514-4AE0-8B01-CA80E8453EB0}"
7+
EndProject
8+
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") ="FSharp.Core","..\src\fsharp\FSharp.Core\FSharp.Core.fsproj","{DED3BBD7-53F4-428A-8C9F-27968E768605}"
9+
EndProject
10+
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") ="FSharp.Compiler.Private","..\src\fsharp\FSharp.Compiler.Private\FSharp.Compiler.Private.fsproj","{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}"
11+
EndProject
12+
Global
13+
GlobalSection(SolutionConfigurationPlatforms) =preSolution
14+
Debug|Any CPU=Debug|Any CPU
15+
Proto|Any CPU=Proto|Any CPU
16+
Release|Any CPU=Release|Any CPU
17+
EndGlobalSection
18+
GlobalSection(ProjectConfigurationPlatforms) =postSolution
19+
{9A3C565C-B514-4AE0-8B01-CA80E8453EB0}.Debug|Any CPU.ActiveCfg=Debug|Any CPU
20+
{9A3C565C-B514-4AE0-8B01-CA80E8453EB0}.Debug|Any CPU.Build.0=Debug|Any CPU
21+
{9A3C565C-B514-4AE0-8B01-CA80E8453EB0}.Proto|Any CPU.ActiveCfg=Release|Any CPU
22+
{9A3C565C-B514-4AE0-8B01-CA80E8453EB0}.Proto|Any CPU.Build.0=Release|Any CPU
23+
{9A3C565C-B514-4AE0-8B01-CA80E8453EB0}.Release|Any CPU.ActiveCfg=Release|Any CPU
24+
{9A3C565C-B514-4AE0-8B01-CA80E8453EB0}.Release|Any CPU.Build.0=Release|Any CPU
25+
{DED3BBD7-53F4-428A-8C9F-27968E768605}.Debug|Any CPU.ActiveCfg=Debug|Any CPU
26+
{DED3BBD7-53F4-428A-8C9F-27968E768605}.Debug|Any CPU.Build.0=Debug|Any CPU
27+
{DED3BBD7-53F4-428A-8C9F-27968E768605}.Proto|Any CPU.ActiveCfg=Debug|Any CPU
28+
{DED3BBD7-53F4-428A-8C9F-27968E768605}.Proto|Any CPU.Build.0=Debug|Any CPU
29+
{DED3BBD7-53F4-428A-8C9F-27968E768605}.Release|Any CPU.ActiveCfg=Release|Any CPU
30+
{DED3BBD7-53F4-428A-8C9F-27968E768605}.Release|Any CPU.Build.0=Release|Any CPU
31+
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Debug|Any CPU.ActiveCfg=Debug|Any CPU
32+
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Debug|Any CPU.Build.0=Debug|Any CPU
33+
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Proto|Any CPU.ActiveCfg=Debug|Any CPU
34+
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Proto|Any CPU.Build.0=Debug|Any CPU
35+
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Release|Any CPU.ActiveCfg=Release|Any CPU
36+
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Release|Any CPU.Build.0=Release|Any CPU
37+
EndGlobalSection
38+
GlobalSection(SolutionProperties) =preSolution
39+
HideSolutionNode =FALSE
40+
EndGlobalSection
41+
GlobalSection(ExtensibilityGlobals) =postSolution
42+
SolutionGuid ={049A4D02-709F-418C-AD59-7FB0DBE956B1}
43+
EndGlobalSection
44+
EndGlobal
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<ProjectSdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net472</TargetFramework>
6+
</PropertyGroup>
7+
8+
<ItemGroup>
9+
<CompileInclude="Program.fs" />
10+
</ItemGroup>
11+
12+
<ItemGroup>
13+
<PackageReferenceInclude="BenchmarkDotNet"Version="0.11.3" />
14+
</ItemGroup>
15+
16+
<ItemGroup>
17+
<ProjectReferenceInclude="..\..\src\fsharp\FSharp.Compiler.Private\FSharp.Compiler.Private.fsproj" />
18+
<ProjectReferenceInclude="..\..\src\fsharp\FSharp.Core\FSharp.Core.fsproj" />
19+
</ItemGroup>
20+
21+
</Project>
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
openSystem
2+
openSystem.IO
3+
openBenchmarkDotNet.Attributes
4+
openBenchmarkDotNet.Running
5+
openMicrosoft.FSharp.Compiler.ErrorLogger
6+
openMicrosoft.FSharp.Compiler.SourceCodeServices
7+
openSystem.Text
8+
9+
[<ClrJob(baseline=true)>]
10+
typeCompilerServiceParsing()=
11+
12+
let mutablecheckerOpt= None
13+
14+
let mutablesourceOpt= None
15+
16+
letparsingOptions=
17+
{
18+
SourceFiles=[|"TypeChecker.fs"|]
19+
ConditionalCompilationDefines=[]
20+
ErrorSeverityOptions= FSharpErrorSeverityOptions.Default
21+
IsInteractive=false
22+
LightSyntax= None
23+
CompilingFsLib=false
24+
IsExe=false
25+
}
26+
27+
[<GlobalSetup>]
28+
member__.Setup()=
29+
match checkerOptwith
30+
| None-> checkerOpt<- Some(FSharpChecker.Create())
31+
|_->()
32+
33+
match sourceOptwith
34+
| None->
35+
letsource= File.ReadAllText("""..\..\..\..\..\src\fsharp\TypeChecker.fs""")
36+
sourceOpt<- Some(source)
37+
|_->()
38+
39+
[<IterationSetup>]
40+
member__.ParsingSetup()=
41+
match checkerOptwith
42+
| None-> failwith"no checker"
43+
| Some(checker)->
44+
checker.InvalidateAll()
45+
checker.ClearLanguageServiceRootCachesAndCollectAndFinalizeAllTransients()
46+
checker.ParseFile("dummy.fs","dummy", parsingOptions)|> Async.RunSynchronously|> ignore
47+
48+
[<Benchmark>]
49+
member__.Parsing()=
50+
match checkerOpt, sourceOptwith
51+
| None,_-> failwith"no checker"
52+
|_, None-> failwith"no source"
53+
| Some(checker), Some(source)->
54+
letresults= checker.ParseFile("TypeChecker.fs", source, parsingOptions)|> Async.RunSynchronously
55+
if results.ParseHadErrorsthen failwithf"parse had errors:%A" results.Errors
56+
57+
[<EntryPoint>]
58+
letmain argv=
59+
let_= BenchmarkRunner.Run<CompilerServiceParsing>()
60+
0

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp