From 1476cb5bdd370fdc6b7dc8c0f1626ed2bc697273 Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Fri, 24 Feb 2023 10:50:41 -0800 Subject: [PATCH 1/4] Add some basic instructions for building the BasicMinimalApi project locally --- .../BasicMinimalApi/BuildingLocally.md | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 src/BenchmarksApps/BasicMinimalApi/BuildingLocally.md diff --git a/src/BenchmarksApps/BasicMinimalApi/BuildingLocally.md b/src/BenchmarksApps/BasicMinimalApi/BuildingLocally.md new file mode 100644 index 000000000..bebc9740e --- /dev/null +++ b/src/BenchmarksApps/BasicMinimalApi/BuildingLocally.md @@ -0,0 +1,47 @@ +# Building Locally + +When experimenting with possible improvements, it can be useful to be able to build this project locally. + +## Setup + +You're going to need a fairly recent version of dotnet (for both basic functionality and accurate baselining). +One way to set that up is to download a [nightly build](https://github.com/dotnet/installer#table) and extract it into a local folder. +(You can also install it, since dotnet handles side-by-side installation, but this can get cluttered if you install a lot of nightlies.) +To use the nightly build you've extracted, you'll want to add the folder where you extracted it to the `PATH` and also set it as the `DOTNET_ROOT`. +On Windows, a batch file for setting these variables might look like + +``` +@echo off +set PATH=c:\dotnet;%PATH% +set DOTNET_ROOT=c:\dotnet\ +``` + +In order to avoid interfering with your other uses of dotnet, it's probably preferable to set those variables only in the prompt where you're building this project. + +Confirm that things are working by running `dotnet --version` - the output should match the build that you downloaded. +Tools like `which` and `where` can also help confirm that you're running the version you expect. + +## Building + +In a prompt with `PATH` and `DOTNET_ROOT` set appropriately, run the following ocmmand +``` +dotnet publish /p:PublishAot=true /p:StripSymbols=true /p:EnableRequestDelegateGenerator=true +``` +The properties and their values come from [goldilocks.benchmarks.yml](../../../scenarios/goldilocks.benchmarks.yml). + +The build should complete without warnings or errors. + +## Validating + +Run `BasicMinimalApi` from the `publish` directory - something like `bin\Release\net8.0\win-x64\publish`. +You should be able to connect to the server at http://localhost:5000/todos. +(It will return a JSON blob.) + +## Experimenting + +As you make changes to your local `aspnetcore` build, you can pull those changes into the benchmark project by adding explicit references to the [csproj file](./BasicMinimalApi.csproj). +```xml + + + +``` From 0e687dd269fa2b85d6441b0fc84fa66e66e56832 Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Fri, 24 Feb 2023 12:14:29 -0800 Subject: [PATCH 2/4] Fix typo Co-authored-by: Eric Erhardt --- src/BenchmarksApps/BasicMinimalApi/BuildingLocally.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BenchmarksApps/BasicMinimalApi/BuildingLocally.md b/src/BenchmarksApps/BasicMinimalApi/BuildingLocally.md index bebc9740e..aaecd5a39 100644 --- a/src/BenchmarksApps/BasicMinimalApi/BuildingLocally.md +++ b/src/BenchmarksApps/BasicMinimalApi/BuildingLocally.md @@ -23,7 +23,7 @@ Tools like `which` and `where` can also help confirm that you're running the ver ## Building -In a prompt with `PATH` and `DOTNET_ROOT` set appropriately, run the following ocmmand +In a prompt with `PATH` and `DOTNET_ROOT` set appropriately, run the following command ``` dotnet publish /p:PublishAot=true /p:StripSymbols=true /p:EnableRequestDelegateGenerator=true ``` From c7bec8ca5c9d9ca3db8c2efd004a5392347416c0 Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Fri, 24 Feb 2023 12:14:55 -0800 Subject: [PATCH 3/4] Don't consider warnings as failures Co-authored-by: Eric Erhardt --- src/BenchmarksApps/BasicMinimalApi/BuildingLocally.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BenchmarksApps/BasicMinimalApi/BuildingLocally.md b/src/BenchmarksApps/BasicMinimalApi/BuildingLocally.md index aaecd5a39..ad4408a11 100644 --- a/src/BenchmarksApps/BasicMinimalApi/BuildingLocally.md +++ b/src/BenchmarksApps/BasicMinimalApi/BuildingLocally.md @@ -29,7 +29,7 @@ dotnet publish /p:PublishAot=true /p:StripSymbols=true /p:EnableRequestDelegateG ``` The properties and their values come from [goldilocks.benchmarks.yml](../../../scenarios/goldilocks.benchmarks.yml). -The build should complete without warnings or errors. +The build should complete without errors. ## Validating From 978d944892f3d2ca0167dc8b77630a522d641c0b Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Fri, 24 Feb 2023 12:15:23 -0800 Subject: [PATCH 4/4] Make argument instructions more explicit Co-authored-by: Eric Erhardt --- src/BenchmarksApps/BasicMinimalApi/BuildingLocally.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BenchmarksApps/BasicMinimalApi/BuildingLocally.md b/src/BenchmarksApps/BasicMinimalApi/BuildingLocally.md index ad4408a11..6105073fd 100644 --- a/src/BenchmarksApps/BasicMinimalApi/BuildingLocally.md +++ b/src/BenchmarksApps/BasicMinimalApi/BuildingLocally.md @@ -27,7 +27,7 @@ In a prompt with `PATH` and `DOTNET_ROOT` set appropriately, run the following c ``` dotnet publish /p:PublishAot=true /p:StripSymbols=true /p:EnableRequestDelegateGenerator=true ``` -The properties and their values come from [goldilocks.benchmarks.yml](../../../scenarios/goldilocks.benchmarks.yml). +The properties and their values come from the `basicminimalapipublishaot` scenario in [goldilocks.benchmarks.yml](../../../scenarios/goldilocks.benchmarks.yml). The build should complete without errors.