-
Notifications
You must be signed in to change notification settings - Fork 257
Commit
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "contract", "contract", "{651F0F6E-86CF-42D2-9110-5F3EAE5704F0}" | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{26990847-E0A2-4FCC-8C71-267CA77557CD}" | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{51CE1A9E-63A0-49C6-B820-C8519C94F389}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
EndGlobal |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<?xml version="1.0"?> | ||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="src\AElf.ContractDeployer\AElf.ContractDeployer.targets" /> | ||
<Import Project="AElf.ContractTools.targets" /> | ||
<Import Project="src\AElf.ContractDeployer\AElf.ContractDeployer.targets"/> | ||
<Import Project="AElf.ContractTools.targets"/> | ||
</Project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
using Xunit; | ||
|
||
[assembly: CollectionBehavior(DisableTestParallelization = true)] | ||
[assembly: CollectionBehavior(DisableTestParallelization = true)] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,40 @@ | ||
using System; | ||
using Google.Protobuf.WellKnownTypes; | ||
|
||
namespace AElf.Benchmark.PerformanceTestContract | ||
namespace AElf.Benchmark.PerformanceTestContract; | ||
|
||
public class PerformanceTestContract : PerformanceTestContractContainer.PerformanceTestContractBase | ||
{ | ||
public class PerformanceTestContract : PerformanceTestContractContainer.PerformanceTestContractBase | ||
public override UInt64Value Fibonacci(UInt64Value input) | ||
{ | ||
public override UInt64Value Fibonacci(UInt64Value input) | ||
{ | ||
var result = CalculateFibonacci(input.Value); | ||
return new UInt64Value {Value = result}; | ||
} | ||
var result = CalculateFibonacci(input.Value); | ||
return new UInt64Value { Value = result }; | ||
} | ||
|
||
private ulong CalculateFibonacci(ulong n) | ||
{ | ||
if (n == 0 || n == 1) | ||
return n; | ||
return CalculateFibonacci(n - 1) + CalculateFibonacci(n - 2); | ||
} | ||
private ulong CalculateFibonacci(ulong n) | ||
{ | ||
if (n == 0 || n == 1) | ||
return n; | ||
return CalculateFibonacci(n - 1) + CalculateFibonacci(n - 2); | ||
} | ||
|
||
public override Int32Value LoopExpNop(PerformanceTesteInput input) | ||
public override Int32Value LoopExpNop(PerformanceTesteInput input) | ||
{ | ||
for (uint i = 0; i < input.N; i++) | ||
{ | ||
for (uint i = 0; i < input.N; i++) | ||
{ | ||
|
||
} | ||
|
||
return new Int32Value {Value = input.Seed}; | ||
} | ||
|
||
public override DoubleValue LoopDivAdd(DivAddTestInput input) | ||
{ | ||
var r = input.X; | ||
for (uint i = 0; i < input.N; i++) | ||
{ | ||
r /= input.Y; | ||
r += input.K; | ||
} | ||
return new Int32Value { Value = input.Seed }; | ||
} | ||
|
||
return new DoubleValue {Value = r}; | ||
public override DoubleValue LoopDivAdd(DivAddTestInput input) | ||
{ | ||
var r = input.X; | ||
for (uint i = 0; i < input.N; i++) | ||
{ | ||
r /= input.Y; | ||
r += input.K; | ||
} | ||
|
||
return new DoubleValue { Value = r }; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
using AElf.Sdk.CSharp.State; | ||
|
||
namespace AElf.Benchmark.PerformanceTestContract | ||
namespace AElf.Benchmark.PerformanceTestContract; | ||
|
||
public class PerformanceTestContractState : ContractState | ||
{ | ||
public class PerformanceTestContractState: ContractState | ||
{ | ||
|
||
} | ||
} |