Request for the webserver to be hosted as in process host to improve performance #138

Closed
opened 2026-01-29 16:32:14 +00:00 by claunia · 6 comments
Owner

Originally created by @nachiappannk on GitHub (Mar 27, 2018).

Originally assigned to: @GregorBiswanger on GitHub.

My understanding of the current architecture

  1. The browser runs in a process (Say Process 1)
  2. The asp.net core web server runs in a process (Say Process 2)
  3. The asp.net core web server listens in a port (Say port 8003)

Request

  1. Run the browser in a process (Say Process 1)
  2. Run the asp.net core web server in the same process (that is Process 1)
  3. Host the web service as in process host. (Link below)
    https://blogs.msdn.microsoft.com/webdev/2017/12/07/testing-asp-net-core-mvc-web-apps-in-memory/

Advantages

  1. In the current approach the server is running as a separate process and is listening on a open port, this could be a security gap. When you host as "in process" there is no open port, and only code running within the process can access the web server.

  2. In the current approach, there is interprocess communication happening over a socket that gets estabilished between the asp.net core server and the browser. Inter process communication is slow as data has to be transferred between processes using IPC. When you run as in-process, there is no inter process communication.

  3. In the current approach, there are multiple processes running for the desktop app, when you host as in-process, there will be only one process.

Further note:

  1. It may take lot of time to get a in process web browser.
  2. It may be that it's not at all possible in a cross platform.

Regards,
Nachiappan
nachiapan@gmail.com

Originally created by @nachiappannk on GitHub (Mar 27, 2018). Originally assigned to: @GregorBiswanger on GitHub. My understanding of the current architecture 1. The browser runs in a process (Say Process 1) 2. The asp.net core web server runs in a process (Say Process 2) 3. The asp.net core web server listens in a port (Say port 8003) Request 1. Run the browser in a process (Say Process 1) 2. Run the asp.net core web server in the same process (that is Process 1) 3. Host the web service as in process host. (Link below) https://blogs.msdn.microsoft.com/webdev/2017/12/07/testing-asp-net-core-mvc-web-apps-in-memory/ Advantages 1. In the current approach the server is running as a separate process and is listening on a open port, this could be a security gap. When you host as "in process" there is no open port, and only code running within the process can access the web server. 2. In the current approach, there is interprocess communication happening over a socket that gets estabilished between the asp.net core server and the browser. Inter process communication is slow as data has to be transferred between processes using IPC. When you run as in-process, there is no inter process communication. 3. In the current approach, there are multiple processes running for the desktop app, when you host as in-process, there will be only one process. Further note: 1. It may take lot of time to get a in process web browser. 2. It may be that it's not at all possible in a cross platform. Regards, Nachiappan nachiapan@gmail.com
claunia added the help wantedFeature labels 2026-01-29 16:32:14 +00:00
Author
Owner

@BrainSlugs83 commented on GitHub (Apr 13, 2018):

I think that's a neat suggestion (at least for windows).

RE:

  1. It may take lot of time to get a in process web browser.

What do you mean by "a lot of time"? -- Do you mean a lot of time to write the code, or a lot of time during the app start up for the browser to initialize?

@BrainSlugs83 commented on GitHub (Apr 13, 2018): I think that's a neat suggestion (at least for windows). RE: > 1. It may take lot of time to get a in process web browser. What do you mean by "a lot of time"? -- Do you mean a lot of time to write the code, or a lot of time during the app start up for the browser to initialize?
Author
Owner

@nachiappannk commented on GitHub (Apr 14, 2018):

I assumed that this could take lot of time for implementing

@nachiappannk commented on GitHub (Apr 14, 2018): I assumed that this could take lot of time for implementing
Author
Owner

@damianh commented on GitHub (Apr 18, 2018):

Related https://github.com/ElectronNET/Electron.NET/issues/22

@damianh commented on GitHub (Apr 18, 2018): Related https://github.com/ElectronNET/Electron.NET/issues/22
Author
Owner

@fydar commented on GitHub (Jan 20, 2019):

There may be potential to interact with Asp.Net Core's upcoming feature "Generic Host".

https://docs.microsoft.com/en-us/aspnet/core/fundamentals/host/?view=aspnetcore-2.2

However, this is such a fundamental change to Electron that it maybe unlikely to happen. However, the benefits of increased performance and security are real.

@fydar commented on GitHub (Jan 20, 2019): There may be potential to interact with Asp.Net Core's upcoming feature "Generic Host". https://docs.microsoft.com/en-us/aspnet/core/fundamentals/host/?view=aspnetcore-2.2 However, this is such a fundamental change to Electron that it maybe unlikely to happen. However, the benefits of increased performance and security are real.
Author
Owner

@robertmuehsig commented on GitHub (Jan 21, 2019):

The problem is to glue Electron and the in-proc server together. The electron side just knows a localhost HTTP adress and works in its own process.
The in-proc ASP.NET Core host doesn't expose anything (which is more or less the desired feature), so how would this interaction work?

@robertmuehsig commented on GitHub (Jan 21, 2019): The problem is to glue Electron and the in-proc server together. The electron side just knows a localhost HTTP adress and works in its own process. The in-proc ASP.NET Core host doesn't expose anything (which is more or less the desired feature), so how would this interaction work?
Author
Owner

@GregorBiswanger commented on GitHub (May 9, 2020):

In Electron.NET 8.31.1 we incease the startup time and we continue to work hard to get it even better.

@GregorBiswanger commented on GitHub (May 9, 2020): In Electron.NET 8.31.1 we incease the startup time and we continue to work hard to get it even better.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#138