-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
82523e4
commit 954148d
Showing
7 changed files
with
180 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 16 | ||
VisualStudioVersion = 16.0.30709.64 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bug48179", "Bug48179\Bug48179.csproj", "{ECBFC915-4001-4ABF-AE41-494BF20BA639}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{ECBFC915-4001-4ABF-AE41-494BF20BA639}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{ECBFC915-4001-4ABF-AE41-494BF20BA639}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{ECBFC915-4001-4ABF-AE41-494BF20BA639}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{ECBFC915-4001-4ABF-AE41-494BF20BA639}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {A5ADCCFE-043A-4C65-921C-AA5496CF24AB} | ||
EndGlobalSection | ||
EndGlobal |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net5.0</TargetFramework> | ||
<ApplicationIcon /> | ||
<OutputType>Exe</OutputType> | ||
<StartupObject /> | ||
<!--<WasmShellGenerateAOTProfile>true</WasmShellGenerateAOTProfile>--> | ||
<WasmShellMonoRuntimeExecutionMode>FullAOT</WasmShellMonoRuntimeExecutionMode> | ||
<!--<WasmShellMonoRuntimeExecutionMode>InterpreterAndAOT</WasmShellMonoRuntimeExecutionMode>--> | ||
<WasmShellEnableEmccProfiling>true</WasmShellEnableEmccProfiling> | ||
<!--<WasmShellDisableSDKCheckSumValidation>true</WasmShellDisableSDKCheckSumValidation>--> | ||
<WasmShellEnableNetCoreICU>false</WasmShellEnableNetCoreICU> | ||
<LangVersion>9.0</LangVersion> | ||
</PropertyGroup> | ||
|
||
<ItemGroup Condition="'$(WasmShellMonoRuntimeExecutionMode)'=='InterpreterAndAOT'"> | ||
<WasmShellEnableAotProfile Include="aot.profile" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<LinkerDescriptor Include="Linker.xml" /> | ||
</ItemGroup> | ||
|
||
<!-- | ||
<ItemGroup> | ||
<WasmShellExtraEmccFlags Include="-fsanitize=address" /> | ||
<WasmShellExtraEmccFlags Include="-s TOTAL_MEMORY=393216000" /> | ||
</ItemGroup> | ||
--> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Uno.Wasm.Bootstrap" Version="2.0.0-dev.163" /> | ||
<PackageReference Include="Uno.Wasm.Bootstrap.DevServer" Version="2.0.0-dev.163" /> | ||
</ItemGroup> | ||
</Project> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<linker> | ||
<assembly fullname="Bug48163"/> | ||
</linker> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel; | ||
using System.Diagnostics; | ||
using System.Linq; | ||
using System.Runtime.CompilerServices; | ||
|
||
static class Program | ||
{ | ||
// const int outerCount = 1; | ||
const int innerCount = 1; | ||
const int maxDepth = 4; | ||
|
||
static void Main(string[] args) | ||
{ | ||
NestedLoopPerf_ForLoop(); | ||
NestedLoopPerf_ForEachLoop(); | ||
} | ||
|
||
private static void NestedLoopPerf_ForLoop() | ||
{ | ||
var list = Enumerable.Range(0, 10).ToList(); | ||
|
||
var r1 = Stopwatch.StartNew(); | ||
Bench(list); | ||
r1.Stop(); | ||
|
||
Console.WriteLine($"r1={r1.Elapsed}"); | ||
|
||
static void Bench(List<int> array) | ||
{ | ||
for (int i = 0; i < innerCount; i++) | ||
{ | ||
Nest(0); | ||
} | ||
|
||
void Nest(int depth) | ||
{ | ||
if(depth == maxDepth) | ||
{ | ||
return; | ||
} | ||
|
||
for (int i = 0; i < array.Count; i++) | ||
{ | ||
Nest(depth + 1); | ||
} | ||
} | ||
} | ||
} | ||
|
||
private static void NestedLoopPerf_ForEachLoop() | ||
{ | ||
var list = Enumerable.Range(0, 10).ToList(); | ||
|
||
var r1 = Stopwatch.StartNew(); | ||
Bench(list); | ||
r1.Stop(); | ||
|
||
Console.WriteLine($"r1={r1.Elapsed}"); | ||
|
||
static void Bench(List<int> list) | ||
{ | ||
for (int i = 0; i < innerCount; i++) | ||
{ | ||
Nest(0); | ||
} | ||
|
||
void Nest(int depth) | ||
{ | ||
if(depth == maxDepth) | ||
{ | ||
return; | ||
} | ||
|
||
foreach(var item in list) | ||
{ | ||
Nest(depth + 1); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"iisSettings": { | ||
"windowsAuthentication": false, | ||
"anonymousAuthentication": true, | ||
"iisExpress": { | ||
"applicationUrl": "http://localhost:49943/", | ||
"sslPort": 44344 | ||
} | ||
}, | ||
"profiles": { | ||
"IIS Express": { | ||
"commandName": "IISExpress", | ||
"launchBrowser": true, | ||
"environmentVariables": { | ||
"ASPNETCORE_ENVIRONMENT": "Development" | ||
} | ||
}, | ||
"Bug44269": { | ||
"commandName": "Project", | ||
"launchBrowser": true, | ||
"environmentVariables": { | ||
"ASPNETCORE_ENVIRONMENT": "Development" | ||
}, | ||
"applicationUrl": "http://localhost:5000" | ||
} | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Repro for issue https://github.com/dotnet/runtime/issues/48163 | ||
|
||
Reproducing this requires .NET 5.0.101 or later, mono and ninja installed. | ||
|
||
Build with `dotnet build` |
Binary file not shown.