diff --git a/frameworks/CSharp/celerio/README.md b/frameworks/CSharp/celerio/README.md new file mode 100644 index 00000000000..438fe9ac12f --- /dev/null +++ b/frameworks/CSharp/celerio/README.md @@ -0,0 +1,23 @@ +# Celerio Benchmarks + +Celerio is a modern C# framework designed for high-performance web applications based on Source Generation **only**. +This benchmark tests Celerio using the standard TechEmpower FrameworkBenchmarks suite. + +## Links + +- [GitHub](https://github.com/Oxule/Celerio) +- [NuGet](https://www.nuget.org/packages/Celerio) + +## Infrastructure Software Versions + +- C# 12 +- .NET 8 + +## Benchmarks Included + +- **Plaintext** +- **JSON** + +## Author + +* [Oxule](https://github.com/Oxule) diff --git a/frameworks/CSharp/celerio/benchmark_config.json b/frameworks/CSharp/celerio/benchmark_config.json new file mode 100644 index 00000000000..9cd233d5d6a --- /dev/null +++ b/frameworks/CSharp/celerio/benchmark_config.json @@ -0,0 +1,26 @@ +{ + "framework": "celerio", + "tests": [ + { + "default": { + "json_url": "/json", + "plaintext_url": "/plaintext", + "port": 8080, + "approach": "Realistic", + "classification": "Micro", + "database": "None", + "framework": "Celerio", + "language": "CSharp", + "flavor": "None", + "orm": "None", + "platform": ".NET", + "webserver": "Celerio", + "os": "Linux", + "database_os": "Linux", + "display_name": "Celerio", + "notes": "", + "versus": "aspcore-mvc" + } + } + ] +} diff --git a/frameworks/CSharp/celerio/celerio.dockerfile b/frameworks/CSharp/celerio/celerio.dockerfile new file mode 100644 index 00000000000..3558ec99b4b --- /dev/null +++ b/frameworks/CSharp/celerio/celerio.dockerfile @@ -0,0 +1,24 @@ +FROM mcr.microsoft.com/dotnet/runtime:8.0 AS base +USER $APP_UID +WORKDIR /app + +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +ARG BUILD_CONFIGURATION=Release +WORKDIR /src +COPY ["src/src.csproj", "src/"] +RUN dotnet restore "src/src.csproj" +COPY . . +WORKDIR "/src/src" +RUN dotnet build "./src.csproj" -c $BUILD_CONFIGURATION -o /app/build + +FROM build AS publish +ARG BUILD_CONFIGURATION=Release +RUN dotnet publish "./src.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . + +EXPOSE 8080 + +ENTRYPOINT ["dotnet", "src.dll"] diff --git a/frameworks/CSharp/celerio/config.toml b/frameworks/CSharp/celerio/config.toml new file mode 100644 index 00000000000..e942fe23094 --- /dev/null +++ b/frameworks/CSharp/celerio/config.toml @@ -0,0 +1,15 @@ +[framework] +name = "celerio" + +[main] +urls.plaintext = "/plaintext" +urls.json = "/json" +approach = "Realistic" +classification = "Micro" +database = "None" +database_os = "Linux" +os = "Linux" +orm = "None" +platform = ".NET" +webserver = "Celerio" +versus = "aspcore-mvc" \ No newline at end of file diff --git a/frameworks/CSharp/celerio/src/.dockerignore b/frameworks/CSharp/celerio/src/.dockerignore new file mode 100644 index 00000000000..cd967fc3a29 --- /dev/null +++ b/frameworks/CSharp/celerio/src/.dockerignore @@ -0,0 +1,25 @@ +**/.dockerignore +**/.env +**/.git +**/.gitignore +**/.project +**/.settings +**/.toolstarget +**/.vs +**/.vscode +**/.idea +**/*.*proj.user +**/*.dbmdl +**/*.jfm +**/azds.yaml +**/bin +**/charts +**/docker-compose* +**/Dockerfile* +**/node_modules +**/npm-debug.log +**/obj +**/secrets.dev.yaml +**/values.dev.yaml +LICENSE +README.md \ No newline at end of file diff --git a/frameworks/CSharp/celerio/src/Endpoints.cs b/frameworks/CSharp/celerio/src/Endpoints.cs new file mode 100644 index 00000000000..eb90fb38413 --- /dev/null +++ b/frameworks/CSharp/celerio/src/Endpoints.cs @@ -0,0 +1,25 @@ +namespace src; + +using Celerio; +using static Celerio.Result; + +public static class Endpoints +{ + [Get("/plaintext")] + public static Result Plaintext() + { + return Ok().Text("Hello, World!"); + } + + [Serializable] + public class SampleResponse + { + public string message { get; set; } = "Hello, World!"; + } + + [Get("/json")] + public static Result Json() + { + return Ok().Json(new SampleResponse()); + } +} \ No newline at end of file diff --git a/frameworks/CSharp/celerio/src/Program.cs b/frameworks/CSharp/celerio/src/Program.cs new file mode 100644 index 00000000000..c442387575e --- /dev/null +++ b/frameworks/CSharp/celerio/src/Program.cs @@ -0,0 +1,6 @@ +using System.Net; +using Celerio.Generated; + +var server = new Server(IPAddress.Any, 8080); +server.Start(); +await Task.Delay(Timeout.Infinite); \ No newline at end of file diff --git a/frameworks/CSharp/celerio/src/src.csproj b/frameworks/CSharp/celerio/src/src.csproj new file mode 100644 index 00000000000..d262c58dd1f --- /dev/null +++ b/frameworks/CSharp/celerio/src/src.csproj @@ -0,0 +1,18 @@ + + + + Exe + net8.0 + preview + enable + enable + + true + Linux + + + + + + +