-
Notifications
You must be signed in to change notification settings - Fork 243
Bring over a few changes from the TechEmpower repo #266
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
Conversation
- incorporate aspnet/FrameworkBenchmarks@4830e2fc, "Only Prepare DbCommand once" - enable more scenarios e.g. "--scenarios plaintext" also enables "mvc/plaintext" scenario - optimize `Content-Length` setting in plaintext scenario - remove unused Microsoft.EntityFrameworkCore.Design dependency and EF tooling - remove irrelevant `#if NET46` code nits: - sort dependencies - clean up whitespace - accept VS suggestions
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.
enable more scenarios e.g. "--scenarios plaintext" also enables "mvc/plaintext" scenario
Does this mean when I run the driver with -n plaintext
I'll be getting more than one job run?
|
||
// HACK: Setting the Content-Length header manually avoids the cost of serializing the int to a string. | ||
// This is instead of: httpContext.Response.ContentLength = payloadLength; | ||
response.Headers["Content-Length"] = "13"; |
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.
What is the perf difference?
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.
I think we want to keep the code in Benchmarks: 19ecf5e
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.
This would be a regression in 2.0 with the add ContentLength to IHeaderDictionary changes; the hack is fixed and no longer needed (and becomes a regression)
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.
🆗 I'll undo this here and fix the TechEmpower code.
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.
You don't want to fix the TechEmpower until it uses 2.0 though.
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.
TechEmpower is being updated to target .NET Core 2.0.0-preview1.
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.
Hooray! 😄
{ | ||
EnableDefault(); | ||
return 2; | ||
} | ||
|
||
var props = typeof(Scenarios).GetTypeInfo().DeclaredProperties | ||
.Where(p => string.Equals(partialName, "[all]", StringComparison.OrdinalIgnoreCase) || p.Name.StartsWith(partialName, StringComparison.OrdinalIgnoreCase)) | ||
.Where(p => string.Equals(partialName, "[all]", StringComparison.OrdinalIgnoreCase) || p.Name.IndexOf(partialName, StringComparison.OrdinalIgnoreCase) >= 0) |
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.
We want to keep StartsWith
: c22b982
If anything I would update TechEmpower to also use StartsWith
.
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.
Shoot that's going to break many of the TechEmpower scripts but I understand the "enable the minimum" motivation.
@@ -17,7 +16,6 @@ | |||
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel.Https" Version="$(AspNetCoreVersion)" /> | |||
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets" Version="$(AspNetCoreVersion)" /> | |||
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="$(AspNetCoreVersion)" /> | |||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="$(AspNetCoreVersion)" PrivateAssets="All" /> |
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.
Do you know why this can/should be removed?
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.
… because databases are automatically created in all cases. No need for dotnet ef database update
, migration management, et cetera.
</ItemGroup> | ||
|
||
<ItemGroup> |
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.
Do you know why this can/should be removed?
@@ -40,7 +40,7 @@ public DapperDb(IRandom random, DbProviderFactory dbProviderFactory, IOptions<Ap | |||
async Task<World> ReadSingleRow(DbConnection db) | |||
{ | |||
return await db.QueryFirstOrDefaultAsync<World>( | |||
"SELECT id, randomnumber FROM world WHERE Id = @Id", | |||
"SELECT id, randomnumber FROM world WHERE id = @Id", |
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.
I think this was required for compat with a particular DB or driver, but either way it seems better all-lowercase.
|
||
// HACK: Setting the Content-Length header manually avoids the cost of serializing the int to a string. | ||
// This is instead of: httpContext.Response.ContentLength = payloadLength; | ||
response.Headers["Content-Length"] = "13"; |
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.
I think we want to keep the code in Benchmarks: 19ecf5e
|
||
// HACK: Setting the Content-Length header manually avoids the cost of serializing the int to a string. | ||
// This is instead of: httpContext.Response.ContentLength = payloadLength; | ||
response.Headers["Content-Length"] = "13"; |
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.
This would be a regression in 2.0 with the add ContentLength to IHeaderDictionary changes
"React to IHeaderDictionary ContentLength change" #170
"[Perf] Add ContentLength to IHeaderDictionary" aspnet/HttpAbstractions#757
"Use ContentLength as primary data source" aspnet/KestrelHttpServer#1313
- enable more scenarios e.g. "--scenarios plaintext" also enables "mvc/plaintext" scenario - stick with enabling the minimum - optimize `Content-Length` setting in plaintext scenario - wasn't an optimization
Content-Length
setting in plaintext scenario#if NET46
codenits: