Skip to content
This repository was archived by the owner on Mar 24, 2026. It is now read-only.

appMpower version 1.0 - #6614

Merged
NateBrady23 merged 3 commits into
TechEmpower:masterfrom
LLT21:appmpowerv1
Jun 8, 2021
Merged

NateBrady23 merged 3 commits into
TechEmpower:masterfrom
LLT21:appmpowerv1

Conversation

@LLT21

@LLT21 LLT21 commented Jun 1, 2021

Copy link
Copy Markdown
Contributor

This implementation in .NET and Kestrel is natively compiled in a reflection-free way. As the .NET ODBC interface library is written in a reflection-free way, this interface is used to PostgreSQL. In these 2 respects, this framework implementation is unique.

@LLT21 LLT21 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the first commit of a new CSharp framework that is special in the following respect:

  1. It is natively compiled with the option to disable reflection: this generates the smallest executable
  2. It uses the ODBC interface instead of the .NET ngpsql library (driven by the reflection free implementation).

Can someone review and if ok approve this as a maintainer as this is a first time contribution ?

@NateBrady23

NateBrady23 commented Jun 4, 2021 •

Copy link
Copy Markdown
Member

Letting CI run and will get around to a review in the next couple of days.

@sebastienros @benaadams @lauxjpn don't know if this is something you guys are interested in looking at.

@lauxjpn

lauxjpn commented Jun 4, 2021

Copy link
Copy Markdown
Contributor

/cc @roji

@benaadams benaadams left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some performance suggestions, but looks good

}
else if (pathStringLength == 5 && pathStringStart == "j")
{
Json.RenderOne(httpResponse.Headers, httpResponseBody.Writer, new JsonMessage { message = "Hello, World!" }, new JsonMessageSerializer());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new JsonMessageSerializer() looks idempotent and everything is passed via parameter; so could hoist this class to a readonly static rather than allocating each time?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review Ben. This recurring suggestion is a good one. As I am new on github since April and this is my first TechEmpower Benchmark pull request, can you just let me know how I best do the change ? Do I start locally in my appMpowerv1 branch, commit there, push to my forked repository and then do a new pull request to this repository ? Just to be sure: I assume your suggestion is like adding

private readonly static WorldSerializer _worldSerializer = new WorldSerializer();

at the top of HttpApplication.cs and using that one ?
Luc

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to be sure: I assume your suggestion is like adding

private readonly static WorldSerializer _worldSerializer = new WorldSerializer();

Yep

Do I start locally in my appMpowerv1 branch, commit there, push to my forked repository and then do a new pull request to this repository ?

If the PR is still open (e.g. this one) you just need to push to same fork and it will automatically update, you don't need to do another pull request.

}
else if (pathStringLength == 3 && pathStringStart == "d")
{
Json.RenderOne(httpResponse.Headers, httpResponseBody.Writer, await RawDb.LoadSingleQueryRow(), new WorldSerializer());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new WorldSerializer() also looks idempotent and everything is passed via parameter; so could hoist this class to a readonly static rather than allocating each time?

}

//Json.RenderMany(httpResponse.Headers, httpResponseBody.Writer, await RawDb.LoadMultipleQueriesRows(count), new WorldSerializer());
Json.RenderMany(httpResponse.Headers, httpResponseBody.Writer, await RawDb.ReadMultipleRows(count), new WorldSerializer());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above

count = 500;
}

Json.RenderMany(httpResponse.Headers, httpResponseBody.Writer, await RawDb.LoadMultipleUpdatesRows(count), new WorldSerializer());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above

@roji

roji commented Jun 4, 2021

Copy link
Copy Markdown
Contributor

@lauxjpn thanks for the ping. Yeah, we discussed in dotnet/aspnetcore#31561 (comment) about using Npgsql. I've done some work to make it reflection-free etc, though I can't say for sure it would work in this scenario. We'll give it a try after this is merged etc.

@NateBrady23
NateBrady23 merged commit 6196a47 into TechEmpower:master Jun 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants