Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Commit

Permalink
update mem perf driver (#2376)
Browse files Browse the repository at this point in the history
* update mem perf driver

* use multiple files

* add flush-the-caches

* add pause
  • Loading branch information
dsyme committed Feb 7, 2017
1 parent a58b501 commit 3bf3960
Show file tree
Hide file tree
Showing 5 changed files with 196 additions and 81 deletions.
1 change: 1 addition & 0 deletions build-everything.proj
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

<ItemGroup Condition="'$(BUILD_VS)'=='1'">
<ProjectsWithNet40 Include="vsintegration/fsharp-vsintegration-src-build.proj" />
<ProjectsWithNet40 Include="vsintegration/Utils/LanguageServiceProfiling/LanguageServiceProfiling.fsproj" />
<ProjectsWithNet40 Include="vsintegration/fsharp-vsintegration-project-templates-build.proj" />
<ProjectsWithNet40 Include="vsintegration/fsharp-vsintegration-item-templates-build.proj" />
<ProjectsWithNet40 Include="vsintegration/fsharp-vsintegration-vsix-build.proj" />
Expand Down
2 changes: 1 addition & 1 deletion vsintegration/Utils/LanguageServiceProfiling/App.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" />
</startup>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,6 @@
</DocumentationFile>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<MinimumVisualStudioVersion Condition="'$(MinimumVisualStudioVersion)' == ''">11</MinimumVisualStudioVersion>
</PropertyGroup>
<Choose>
<When Condition="'$(VisualStudioVersion)' == '11.0'">
<PropertyGroup Condition="Exists('$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets')">
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets')">
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
</Otherwise>
</Choose>
<Import Project="$(FSharpTargetsPath)" />
<ItemGroup>
<Compile Include="AssemblyInfo.fs" />
<Compile Include="ProjectCracker.fs" />
Expand All @@ -74,7 +58,7 @@
<Reference Include="System.Core" />
<Reference Include="System.Numerics" />
<Reference Include="System.ValueTuple">
<HintPath>..\..\..\packages\System.ValueTuple.4.3.0\lib\netstandard1.0\System.ValueTuple.dll</HintPath>
<HintPath>$(FSharpSourcesRoot)\..\packages\System.ValueTuple.4.3.0\lib\netstandard1.0\System.ValueTuple.dll</HintPath>
</Reference>
<Reference Include="System.Xml" />
</ItemGroup>
Expand All @@ -90,11 +74,5 @@
<Private>True</Private>
</ProjectReference>
</ItemGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<Import Project="$(FSharpSourcesRoot)\FSharpSource.targets" />
</Project>
46 changes: 32 additions & 14 deletions vsintegration/Utils/LanguageServiceProfiling/Options.fs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module internal rec LanguageServiceProfiling.Options
module internal LanguageServiceProfiling.Options

open Microsoft.FSharp.Compiler
open Microsoft.FSharp.Compiler.Range
Expand All @@ -17,22 +17,16 @@ type CompletionPosition = {
type Options =
{ Options: FSharpProjectOptions
FileToCheck: string
FilesToCheck: string list
SymbolText: string
SymbolPos: pos
CompletionPositions: CompletionPosition list }

let get (repositoryDir: string) : Options =
match DirectoryInfo(repositoryDir).Name.ToLower() with
| "fsharp.compiler.service" -> FCS(repositoryDir)
| "fsharpvspowertools" -> VFPT(repositoryDir)
| _ -> failwithf "%s is not supported" repositoryDir

let FCS (repositoryDir: string) : Options =
{ Options =
{ProjectFileName = repositoryDir </> @"src\fsharp\FSharp.Compiler.Service\FSharp.Compiler.Service.fsproj"
ProjectFileNames =
[| @"src\fsharp\FSharp.Compiler.Service\obj\Debug\FSComp.fs"
@"src\fsharp\FSharp.Compiler.Service\obj\Debug\FSIstrings.fs"
let files =
[| @"src\fsharp\FSharp.Compiler.Service\obj\Release\FSComp.fs"
@"src\fsharp\FSharp.Compiler.Service\obj\Release\FSIstrings.fs"
@"src\assemblyinfo\assemblyinfo.FSharp.Compiler.Service.dll.fs"
@"src\assemblyinfo\assemblyinfo.shared.fs"
@"src\utils\reshapedreflection.fs"
Expand Down Expand Up @@ -199,9 +193,12 @@ let FCS (repositoryDir: string) : Options =
@"src\fsharp\vs\SimpleServices.fs"
@"src\fsharp\fsi\fsi.fsi"
@"src\fsharp\fsi\fsi.fs" |]
|> Array.map (fun x -> repositoryDir </> x)

{ Options =
{ProjectFileName = repositoryDir </> @"src\fsharp\FSharp.Compiler.Service\FSharp.Compiler.Service.fsproj"
ProjectFileNames = files |> Array.map (fun x -> repositoryDir </> x)
OtherOptions =
[|@"-o:obj\Debug\FSharp.Compiler.Service.dll"; "-g"; "--noframework";
[|@"-o:obj\Release\FSharp.Compiler.Service.dll"; "-g"; "--noframework";
@"--baseaddress:0x06800000"; "--define:DEBUG";
@"--define:CROSS_PLATFORM_COMPILER"; "--define:FX_ATLEAST_45";
@"--define:FX_ATLEAST_40"; "--define:BE_SECURITY_TRANSPARENT";
Expand All @@ -219,6 +216,7 @@ let FCS (repositoryDir: string) : Options =
@"-r:" + (repositoryDir </> @"packages\Microsoft.DiaSymReader.PortablePdb\lib\net45\Microsoft.DiaSymReader.PortablePdb.dll");
@"-r:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\mscorlib.dll";
@"-r:" + (repositoryDir </> @"packages\System.Collections.Immutable\lib\netstandard1.0\System.Collections.Immutable.dll");
@"-r:" + (repositoryDir </> @"packages\FSharp.Core\lib\net40\FSharp.Core.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.dll";
@"-r:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Numerics.dll";
Expand Down Expand Up @@ -286,6 +284,17 @@ let FCS (repositoryDir: string) : Options =
UnresolvedReferences = None;
OriginalLoadReferences = []
ExtraProjectInfo = None }
FilesToCheck =
files
|> Array.filter (fun s -> s.Contains "TypeChecker.fs" ||
s.Contains "Optimizer.fs" ||
s.Contains "IlxGen.fs" ||
s.Contains "TastOps.fs" ||
s.Contains "TcGlobals.fs" ||
s.Contains "CompileOps.fs" ||
s.Contains "CompileOptions.fs")
|> Array.map (fun x -> repositoryDir </> x)
|> Array.toList
FileToCheck = repositoryDir </> @"src\fsharp\TypeChecker.fs"
SymbolText = "Some"
SymbolPos = mkPos 120 7
Expand Down Expand Up @@ -395,6 +404,7 @@ let VFPT (repositoryDir: string) : Options =
UnresolvedReferences = None
OriginalLoadReferences = []
ExtraProjectInfo = None }
FilesToCheck = []
FileToCheck = repositoryDir </> @"src\FSharp.Editing\CodeGeneration\RecordStubGenerator.fs"
SymbolText = "option"
SymbolPos = mkPos 19 23
Expand All @@ -404,4 +414,12 @@ let VFPT (repositoryDir: string) : Options =
QualifyingNames = []
PartialName = ""
}]
}
}

let get (repositoryDir: string) : Options =
let repositoryDir = Path.GetFullPath(repositoryDir)
match DirectoryInfo(Path.GetFullPath(repositoryDir)).Name.ToLower() with
| "fsharp.compiler.service" -> FCS(repositoryDir)
| "fsharpvspowertools" -> VFPT(repositoryDir)
| _ -> failwithf "%s is not supported" repositoryDir

Loading

0 comments on commit 3bf3960

Please sign in to comment.