-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrated to new Interop patterns. Expanded on Performance Validations.
- Loading branch information
Showing
25 changed files
with
1,023 additions
and
846 deletions.
There are no files selected for viewing
13 changes: 7 additions & 6 deletions
13
EventHorizon.Blazor.Interop.Sample/EventHorizon.Blazor.Interop.Sample.csproj
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
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
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
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
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
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
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
36 changes: 36 additions & 0 deletions
36
...or.Interop.Sample/Pages/Testing/InteropTesting/GetPerformance/InteropSetDecimalTest.razor
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 @@ | ||
@using System.Diagnostics | ||
@using EventHorizon.Blazor.Interop; | ||
|
||
<div> | ||
<h3>Interop Set Decimal Test</h3> | ||
<div class="--lighter">Interop Set</div> | ||
<ReportTimeTaken Runs="_max" TimeTaken="TimeTaken" /> | ||
<button class="run-btn" @onclick="HandleRunTest">Run</button> | ||
</div> | ||
|
||
@code { | ||
public TimeSpan TimeTaken { get; set; } | ||
|
||
const int _max = 1_000; | ||
private void HandleRunTest() | ||
{ | ||
var s1 = Stopwatch.StartNew(); | ||
for (int i = 0; i < _max; i++) | ||
{ | ||
|
||
RunTest(); | ||
} | ||
s1.Stop(); | ||
TimeTaken = s1.Elapsed; | ||
Console.WriteLine(((double)(s1.ElapsedMilliseconds * 1000000) / _max).ToString("0.00 ns")); | ||
} | ||
|
||
public void RunTest() | ||
{ | ||
EventHorizonBlazorInterop.Set( | ||
"setPrimitive", | ||
"setNumber", | ||
999.99m | ||
); | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
...azor.Interop.Sample/Pages/Testing/InteropTesting/GetPerformance/InteropSetFloatTest.razor
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,35 @@ | ||
@using System.Diagnostics | ||
@using EventHorizon.Blazor.Interop; | ||
|
||
<div> | ||
<h3>Interop Set Float Test</h3> | ||
<div class="--lighter">Interop Set</div> | ||
<ReportTimeTaken Runs="_max" TimeTaken="TimeTaken" /> | ||
<button class="run-btn" @onclick="HandleRunTest">Run</button> | ||
</div> | ||
|
||
@code { | ||
public TimeSpan TimeTaken { get; set; } | ||
|
||
const int _max = 1_000; | ||
private void HandleRunTest() | ||
{ | ||
var s1 = Stopwatch.StartNew(); | ||
for (int i = 0; i < _max; i++) | ||
{ | ||
RunTest(); | ||
} | ||
s1.Stop(); | ||
TimeTaken = s1.Elapsed; | ||
Console.WriteLine(((double)(s1.ElapsedMilliseconds * 1000000) / _max).ToString("0.00 ns")); | ||
} | ||
|
||
public void RunTest() | ||
{ | ||
EventHorizonBlazorInterop.Set( | ||
"setPrimitive", | ||
"setNumber", | ||
99.99f | ||
); | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
...Blazor.Interop.Sample/Pages/Testing/InteropTesting/GetPerformance/InteropSetIntTest.razor
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,35 @@ | ||
@using System.Diagnostics | ||
@using EventHorizon.Blazor.Interop; | ||
|
||
<div> | ||
<h3>Interop Set Int Test</h3> | ||
<div class="--lighter">Interop Set</div> | ||
<ReportTimeTaken Runs="_max" TimeTaken="TimeTaken" /> | ||
<button class="run-btn" @onclick="HandleRunTest">Run</button> | ||
</div> | ||
|
||
@code { | ||
public TimeSpan TimeTaken { get; set; } | ||
|
||
const int _max = 1_000; | ||
private void HandleRunTest() | ||
{ | ||
var s1 = Stopwatch.StartNew(); | ||
for (int i = 0; i < _max; i++) | ||
{ | ||
RunTest(); | ||
} | ||
s1.Stop(); | ||
TimeTaken = s1.Elapsed; | ||
Console.WriteLine(((double)(s1.ElapsedMilliseconds * 1000000) / _max).ToString("0.00 ns")); | ||
} | ||
|
||
public void RunTest() | ||
{ | ||
EventHorizonBlazorInterop.Set( | ||
"setPrimitive", | ||
"setInt", | ||
9999 | ||
); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...nterop.Sample/Pages/Testing/InteropTesting/GetPerformance/InteropSetPerformancePage.razor
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,10 @@ | ||
@page "/interop/performance/set" | ||
|
||
<h1>Interop Set Performance</h1> | ||
|
||
<div class="testing-content"> | ||
<InteropSetDecimalTest /> | ||
<InteropSetFloatTest /> | ||
<InteropSetIntTest /> | ||
<InteropSetTest /> | ||
</div> |
35 changes: 35 additions & 0 deletions
35
...on.Blazor.Interop.Sample/Pages/Testing/InteropTesting/GetPerformance/InteropSetTest.razor
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,35 @@ | ||
@using System.Diagnostics | ||
@using EventHorizon.Blazor.Interop; | ||
|
||
<div> | ||
<h3>Interop Set Test</h3> | ||
<div class="--lighter">Interop Set</div> | ||
<ReportTimeTaken TimeTaken="TimeTaken" Runs="_max" /> | ||
<button class="run-btn" @onclick="HandleRunTest">Run</button> | ||
</div> | ||
|
||
@code { | ||
public TimeSpan TimeTaken { get; set; } | ||
|
||
const int _max = 1_000; | ||
private void HandleRunTest() | ||
{ | ||
var s1 = Stopwatch.StartNew(); | ||
for (int i = 0; i < _max; i++) | ||
{ | ||
RunTest(); | ||
} | ||
s1.Stop(); | ||
TimeTaken = s1.Elapsed; | ||
Console.WriteLine(((double)(s1.ElapsedMilliseconds * 1000000) / _max).ToString("0.00 ns")); | ||
} | ||
|
||
public void RunTest() | ||
{ | ||
EventHorizonBlazorInterop.Set( | ||
"setPrimitive", | ||
"setString", | ||
"location" | ||
); | ||
} | ||
} |
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
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
Oops, something went wrong.