Add project files.

This commit is contained in:
2025-08-18 17:11:43 +03:30
parent 807dc263be
commit e5eb10d604
3943 changed files with 223719 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
<Project>
<ItemGroup>
<PackageReference Include="BenchmarkDotNet"/>
</ItemGroup>
</Project>
@@ -0,0 +1,14 @@
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Diagnosers;
using BenchmarkDotNet.Exporters;
namespace Elsa.Workflows.PerformanceTests;
public class Config : ManualConfig
{
public Config()
{
AddExporter(MarkdownExporter.GitHub);
AddDiagnoser(MemoryDiagnoser.Default);
}
}
@@ -0,0 +1,32 @@
using BenchmarkDotNet.Attributes;
using Elsa.Extensions;
using Elsa.Workflows.Activities;
using Microsoft.Extensions.DependencyInjection;
namespace Elsa.Workflows.PerformanceTests;
[Config(typeof(Config))]
public class ConsoleActivitiesBenchmark
{
private WriteLine _writeLineWorkflow;
private IWorkflowRunner _workflowRunner;
private ServiceProvider _serviceProvider;
[GlobalSetup]
public void GlobalSetup()
{
var services = new ServiceCollection();
services.AddElsa();
_serviceProvider = services.BuildServiceProvider();
_workflowRunner = _serviceProvider.GetRequiredService<IWorkflowRunner>();
_writeLineWorkflow = new WriteLine("Hello, World!");
}
[Benchmark]
public async Task WriteLine() => await _workflowRunner.RunAsync(_writeLineWorkflow);
[GlobalCleanup]
public void GlobalCleanup() => _serviceProvider.Dispose();
}
@@ -0,0 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<OutputType>Exe</OutputType>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\src\modules\Elsa\Elsa.csproj" />
</ItemGroup>
</Project>
@@ -0,0 +1,4 @@
using BenchmarkDotNet.Running;
BenchmarkSwitcher switcher = new(typeof(Program).Assembly);
switcher.Run(args);