Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions CommonNovel.sln
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{0AB3BF05
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommonNovel.Tests", "tests\CommonNovel.Tests\CommonNovel.Tests.csproj", "{AF5365B4-F207-40E4-B1B6-298374455C93}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommonNovel.Benchmarks", "src\CommonNovel.Benchmarks\CommonNovel.Benchmarks.csproj", "{C782F417-5DCF-4482-8EFB-D54570ABC040}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -45,13 +47,26 @@ Global
{AF5365B4-F207-40E4-B1B6-298374455C93}.Release|x64.Build.0 = Release|Any CPU
{AF5365B4-F207-40E4-B1B6-298374455C93}.Release|x86.ActiveCfg = Release|Any CPU
{AF5365B4-F207-40E4-B1B6-298374455C93}.Release|x86.Build.0 = Release|Any CPU
{C782F417-5DCF-4482-8EFB-D54570ABC040}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C782F417-5DCF-4482-8EFB-D54570ABC040}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C782F417-5DCF-4482-8EFB-D54570ABC040}.Debug|x64.ActiveCfg = Debug|Any CPU
{C782F417-5DCF-4482-8EFB-D54570ABC040}.Debug|x64.Build.0 = Debug|Any CPU
{C782F417-5DCF-4482-8EFB-D54570ABC040}.Debug|x86.ActiveCfg = Debug|Any CPU
{C782F417-5DCF-4482-8EFB-D54570ABC040}.Debug|x86.Build.0 = Debug|Any CPU
{C782F417-5DCF-4482-8EFB-D54570ABC040}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C782F417-5DCF-4482-8EFB-D54570ABC040}.Release|Any CPU.Build.0 = Release|Any CPU
{C782F417-5DCF-4482-8EFB-D54570ABC040}.Release|x64.ActiveCfg = Release|Any CPU
{C782F417-5DCF-4482-8EFB-D54570ABC040}.Release|x64.Build.0 = Release|Any CPU
{C782F417-5DCF-4482-8EFB-D54570ABC040}.Release|x86.ActiveCfg = Release|Any CPU
{C782F417-5DCF-4482-8EFB-D54570ABC040}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{5717E758-2B46-461F-27F5-9724EAA2920E} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
{AF5365B4-F207-40E4-B1B6-298374455C93} = {0AB3BF05-4346-4AA6-1389-037BE0695223}
{C782F417-5DCF-4482-8EFB-D54570ABC040} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {1FBD48FA-C758-455E-8E2F-D41EBD6A3754}
Expand Down
18 changes: 18 additions & 0 deletions src/CommonNovel.Benchmarks/CommonNovel.Benchmarks.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.15.8" />
Comment thread
Lemon73-Computing marked this conversation as resolved.
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\CommonNovel\CommonNovel.csproj" />
</ItemGroup>

</Project>
41 changes: 41 additions & 0 deletions src/CommonNovel.Benchmarks/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
Comment thread
Lemon73-Computing marked this conversation as resolved.

namespace CommonNovel.Benchmarks;

public class Program
{
public static void Main(string[] args)
=> BenchmarkRunner.Run<Benchmarks>();
}

[MemoryDiagnoser]
public class Benchmarks
{
private readonly string _input =
"""
- Alice
[Hi, Bob!]

- Bob
[Alice!]

""";

private readonly string _inputNode =
"""
- Alice
[Hi, there.]
""";

private readonly string[] _inputAST = ["CharacterName", "Alice"];

[Benchmark]
public void RunNoder() => _ = Compiler.Noder(_input);

[Benchmark]
public void RunParser() => _ = Compiler.Parse(_inputNode);

[Benchmark]
public void RunExecutor() => _ = Compiler.Executor(_inputAST);
}
Comment thread
Lemon73-Computing marked this conversation as resolved.
1 change: 1 addition & 0 deletions src/CommonNovel.Benchmarks/TEMP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
run `dotnet run -c Release`
Comment thread
Lemon73-Computing marked this conversation as resolved.
34 changes: 0 additions & 34 deletions src/CommonNovel/Emitter.cs

This file was deleted.

36 changes: 0 additions & 36 deletions tests/CommonNovel.Tests/Emitter.cs

This file was deleted.

Loading