Skip to content

Commit 6823e07

Browse files
authored
Add Celerio C# framework benchmark (#10129)
* Add Celerio C# framework benchmark * Add Celerio C# framework benchmark * Readme fix
1 parent 3d025b6 commit 6823e07

File tree

8 files changed

+162
-0
lines changed

8 files changed

+162
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Celerio Benchmarks
2+
3+
Celerio is a modern C# framework designed for high-performance web applications based on Source Generation **only**.
4+
This benchmark tests Celerio using the standard TechEmpower FrameworkBenchmarks suite.
5+
6+
## Links
7+
8+
- [GitHub](https://github.com/Oxule/Celerio)
9+
- [NuGet](https://www.nuget.org/packages/Celerio)
10+
11+
## Infrastructure Software Versions
12+
13+
- C# 12
14+
- .NET 8
15+
16+
## Benchmarks Included
17+
18+
- **Plaintext**
19+
- **JSON**
20+
21+
## Author
22+
23+
* [Oxule](https://github.com/Oxule)
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"framework": "celerio",
3+
"tests": [
4+
{
5+
"default": {
6+
"json_url": "/json",
7+
"plaintext_url": "/plaintext",
8+
"port": 8080,
9+
"approach": "Realistic",
10+
"classification": "Micro",
11+
"database": "None",
12+
"framework": "Celerio",
13+
"language": "CSharp",
14+
"flavor": "None",
15+
"orm": "None",
16+
"platform": ".NET",
17+
"webserver": "Celerio",
18+
"os": "Linux",
19+
"database_os": "Linux",
20+
"display_name": "Celerio",
21+
"notes": "",
22+
"versus": "aspcore-mvc"
23+
}
24+
}
25+
]
26+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
FROM mcr.microsoft.com/dotnet/runtime:8.0 AS base
2+
USER $APP_UID
3+
WORKDIR /app
4+
5+
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
6+
ARG BUILD_CONFIGURATION=Release
7+
WORKDIR /src
8+
COPY ["src/src.csproj", "src/"]
9+
RUN dotnet restore "src/src.csproj"
10+
COPY . .
11+
WORKDIR "/src/src"
12+
RUN dotnet build "./src.csproj" -c $BUILD_CONFIGURATION -o /app/build
13+
14+
FROM build AS publish
15+
ARG BUILD_CONFIGURATION=Release
16+
RUN dotnet publish "./src.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
17+
18+
FROM base AS final
19+
WORKDIR /app
20+
COPY --from=publish /app/publish .
21+
22+
EXPOSE 8080
23+
24+
ENTRYPOINT ["dotnet", "src.dll"]
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[framework]
2+
name = "celerio"
3+
4+
[main]
5+
urls.plaintext = "/plaintext"
6+
urls.json = "/json"
7+
approach = "Realistic"
8+
classification = "Micro"
9+
database = "None"
10+
database_os = "Linux"
11+
os = "Linux"
12+
orm = "None"
13+
platform = ".NET"
14+
webserver = "Celerio"
15+
versus = "aspcore-mvc"
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
**/.dockerignore
2+
**/.env
3+
**/.git
4+
**/.gitignore
5+
**/.project
6+
**/.settings
7+
**/.toolstarget
8+
**/.vs
9+
**/.vscode
10+
**/.idea
11+
**/*.*proj.user
12+
**/*.dbmdl
13+
**/*.jfm
14+
**/azds.yaml
15+
**/bin
16+
**/charts
17+
**/docker-compose*
18+
**/Dockerfile*
19+
**/node_modules
20+
**/npm-debug.log
21+
**/obj
22+
**/secrets.dev.yaml
23+
**/values.dev.yaml
24+
LICENSE
25+
README.md
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
namespace src;
2+
3+
using Celerio;
4+
using static Celerio.Result;
5+
6+
public static class Endpoints
7+
{
8+
[Get("/plaintext")]
9+
public static Result Plaintext()
10+
{
11+
return Ok().Text("Hello, World!");
12+
}
13+
14+
[Serializable]
15+
public class SampleResponse
16+
{
17+
public string message { get; set; } = "Hello, World!";
18+
}
19+
20+
[Get("/json")]
21+
public static Result Json()
22+
{
23+
return Ok().Json(new SampleResponse());
24+
}
25+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
using System.Net;
2+
using Celerio.Generated;
3+
4+
var server = new Server(IPAddress.Any, 8080);
5+
server.Start();
6+
await Task.Delay(Timeout.Infinite);
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net8.0</TargetFramework>
6+
<LangVersion>preview</LangVersion>
7+
<ImplicitUsings>enable</ImplicitUsings>
8+
<Nullable>enable</Nullable>
9+
<!--<PublishAot>true</PublishAot>-->
10+
<InvariantGlobalization>true</InvariantGlobalization>
11+
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
12+
</PropertyGroup>
13+
14+
<ItemGroup>
15+
<PackageReference Include="Celerio" Version="2.0.0-preview.1" />
16+
</ItemGroup>
17+
18+
</Project>

0 commit comments

Comments
 (0)