-
Notifications
You must be signed in to change notification settings - Fork 240
Improve UPDATES query for Platform #2132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sebastienros
wants to merge
5
commits into
main
Choose a base branch
from
sebros/updates
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
32 changes: 0 additions & 32 deletions
32
src/BenchmarksApps/TechEmpower/PlatformBenchmarks/Data/Random.cs
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,98 @@ | ||
| #:sdk Aspire.AppHost.Sdk@13.0.0 | ||
|
|
||
| var builder = DistributedApplication.CreateBuilder(args); | ||
|
|
||
| // Add the postgres database from Dockerfile | ||
| var postgres = builder.AddDockerfile("postgres-techempower", "../../../docker/postgres-techempower") | ||
| .WithEndpoint(port: 5432, targetPort: 5432, name: "tcp") | ||
| .WithEnvironment("POSTGRES_USER", "benchmarkdbuser") | ||
| .WithEnvironment("POSTGRES_PASSWORD", "benchmarkdbpass") | ||
| .WithEnvironment("POSTGRES_DB", "hello_world"); | ||
|
|
||
| var postgresEndpoint = postgres.GetEndpoint("tcp"); | ||
| var connectionString = ReferenceExpression.Create($"Server={postgresEndpoint.Property(EndpointProperty.Host)};Port={postgresEndpoint.Property(EndpointProperty.Port)};Database=hello_world;User Id=benchmarkdbuser;Password=benchmarkdbpass"); | ||
|
|
||
| // Add all TechEmpower benchmark applications | ||
| // Note: BlazorSSR, Minimal, Mvc only support net8.0. MvcFull targets .NET Framework 4.8. | ||
| // PlatformBenchmarks and RazorPages support net8.0;net9.0 multi-targeting. | ||
|
|
||
| builder.AddProject("blazorssr", "BlazorSSR/BlazorSSR.csproj") | ||
| .WaitFor(postgres) | ||
| .WithEnvironment("ConnectionString", connectionString) | ||
| .WithUrls(context => | ||
| { | ||
| var http = context.GetEndpoint("http"); | ||
| if (http is not null) | ||
| { | ||
| context.Urls.Add(new() { Url = $"{http.Url}/plaintext", DisplayText = "plaintext" }); | ||
| context.Urls.Add(new() { Url = $"{http.Url}/json", DisplayText = "json" }); | ||
| context.Urls.Add(new() { Url = $"{http.Url}/fortunes", DisplayText = "fortunes" }); | ||
| context.Urls.Add(new() { Url = $"{http.Url}/updates/20", DisplayText = "updates" }); | ||
| } | ||
| }); | ||
|
|
||
| builder.AddProject("minimal", "Minimal/Minimal.csproj") | ||
| .WaitFor(postgres) | ||
| .WithEnvironment("ConnectionString", connectionString) | ||
| .WithUrls(context => | ||
| { | ||
| var http = context.GetEndpoint("http"); | ||
| if (http is not null) | ||
| { | ||
| context.Urls.Add(new() { Url = $"{http.Url}/plaintext", DisplayText = "plaintext" }); | ||
| context.Urls.Add(new() { Url = $"{http.Url}/json", DisplayText = "json" }); | ||
| context.Urls.Add(new() { Url = $"{http.Url}/fortunes", DisplayText = "fortunes" }); | ||
| context.Urls.Add(new() { Url = $"{http.Url}/updates/20", DisplayText = "updates" }); | ||
| } | ||
| }); | ||
|
|
||
| builder.AddProject("mvc", "Mvc/Mvc.csproj") | ||
| .WaitFor(postgres) | ||
| .WithEnvironment("ConnectionString", connectionString) | ||
| .WithUrls(context => | ||
| { | ||
| var http = context.GetEndpoint("http"); | ||
| if (http is not null) | ||
| { | ||
| context.Urls.Add(new() { Url = $"{http.Url}/plaintext", DisplayText = "plaintext" }); | ||
| context.Urls.Add(new() { Url = $"{http.Url}/json", DisplayText = "json" }); | ||
| context.Urls.Add(new() { Url = $"{http.Url}/fortunes", DisplayText = "fortunes" }); | ||
| context.Urls.Add(new() { Url = $"{http.Url}/updates/20", DisplayText = "updates" }); | ||
| } | ||
| }); | ||
|
|
||
| builder.AddProject("platformbenchmarks", "PlatformBenchmarks/PlatformBenchmarks.csproj") | ||
| .WaitFor(postgres) | ||
| .WithEnvironment("ConnectionString", connectionString) | ||
| .WithArgs("--framework", "net9.0") | ||
| .WithArgs("-p:IsDatabase=true") | ||
| .WithEnvironment("DATABASE", "PostgreSql") | ||
| .WithUrls(context => | ||
| { | ||
| var http = context.GetEndpoint("http"); | ||
| if (http is not null) | ||
| { | ||
| context.Urls.Add(new() { Url = $"{http.Url}/plaintext", DisplayText = "plaintext" }); | ||
| context.Urls.Add(new() { Url = $"{http.Url}/json", DisplayText = "json" }); | ||
| context.Urls.Add(new() { Url = $"{http.Url}/fortunes", DisplayText = "fortunes" }); | ||
| context.Urls.Add(new() { Url = $"{http.Url}/updates/20", DisplayText = "updates" }); | ||
| } | ||
| }); | ||
|
|
||
| builder.AddProject("razorpages", "RazorPages/RazorPages.csproj") | ||
| .WaitFor(postgres) | ||
| .WithEnvironment("ConnectionString", connectionString) | ||
| .WithArgs("--framework", "net9.0") | ||
| .WithUrls(context => | ||
| { | ||
| var http = context.GetEndpoint("http"); | ||
| if (http is not null) | ||
| { | ||
| context.Urls.Add(new() { Url = $"{http.Url}/plaintext", DisplayText = "plaintext" }); | ||
| context.Urls.Add(new() { Url = $"{http.Url}/json", DisplayText = "json" }); | ||
| context.Urls.Add(new() { Url = $"{http.Url}/fortunes", DisplayText = "fortunes" }); | ||
| context.Urls.Add(new() { Url = $"{http.Url}/updates/20", DisplayText = "updates" }); | ||
| } | ||
| }); | ||
|
|
||
| builder.Build().Run(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| { | ||
| "$schema": "https://json.schemastore.org/launchsettings.json", | ||
| "profiles": { | ||
| "https": { | ||
| "commandName": "Project", | ||
| "dotnetRunMessages": true, | ||
| "launchBrowser": true, | ||
| "applicationUrl": "https://localhost:17005;http://localhost:15223", | ||
| "environmentVariables": { | ||
| "ASPNETCORE_ENVIRONMENT": "Development", | ||
| "DOTNET_ENVIRONMENT": "Development", | ||
| "ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL": "https://localhost:21012", | ||
| "ASPIRE_DASHBOARD_MCP_ENDPOINT_URL": "https://localhost:23127", | ||
| "ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL": "https://localhost:22253" | ||
| } | ||
| }, | ||
| "http": { | ||
| "commandName": "Project", | ||
| "dotnetRunMessages": true, | ||
| "launchBrowser": true, | ||
| "applicationUrl": "http://localhost:15223", | ||
| "environmentVariables": { | ||
| "ASPNETCORE_ENVIRONMENT": "Development", | ||
| "DOTNET_ENVIRONMENT": "Development", | ||
| "ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL": "http://localhost:19080", | ||
| "ASPIRE_DASHBOARD_MCP_ENDPOINT_URL": "http://localhost:18252", | ||
| "ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL": "http://localhost:20285" | ||
| } | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given how small this array is, could we
stackallocit?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right here probably (I had tried on the update method at first), there is a
MemoryExtensionsmethod to do that on spans.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got confused by the diff but we can't do this in the updates scenario because we need to pass the ids array as a parameter.
https://github.com/aspnet/Benchmarks/pull/2132/files#diff-c1e1042637f371e2cbc5f6e975883c9c038a0b0de7d30c4e7c55b5bfa45c0f5aR225
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ArrayPoolthen?