Console, Windows Forms or MVC what’s the fastest for heavy loads?

Asked

Viewed 190 times

7

I’m developing a program that will basically have the following cycle:

  • Database query(some milliseconds)
  • For each record will perform the following process:
Início
|
Parse de um XML web (alguns milisegundos pra executar)
|
Download de imagens da web (5 imagens, alguns segundos)
|
Gravação no banco de dados (alguns milisegundos)
|
Fim

I’m still waiting for the answer from What is the difference between async, multithereading, parallelism and competition? to know some differences between asynchronous processes.

But on what platform would it run the fastest? imagining that in all would have a simple layout, focused on performance, to run thousands of times a day.

I think the Console would be the best way, because it is run directly on the machine, different from the MVC that runs through an intermediate layer that would be the IIS.

But there is something that ASP.NET has to help?

NOTE: The software doesn’t need human interaction, it won’t need clicks, nothing.

3 answers

7


If it is a program completely without interface can create a Windows Forms project, remove the created Form (Form1.cs) and change Program.cs, to look like this:

static class Program
{
    static void Main()
    {
    }
}

And finally remove all references, and add again the measure of necessary.

So the program is very minimalist and without UI. I think this is the way to have the least overhead.

  • 1

    but it practically would be a Console right? so I think the Console is still the best option.

  • 2

    It would not be possible to access anything from the console. Also, when running, a console would not be created. Therefore, overhead is smaller than an executable that uses console.

  • Cool, this comment is worth is in the reply, abs

5

It makes no difference because the processing has nothing to do with the user interface.

It is even difficult to compare their performance because the interface should not be chosen by which is faster, but rather which meets the user’s need. Certainly console is faster, but if one needs to access from anywhere, can not install anything, has to be something spontaneous access, of course ASP.NET solves better. Just as if the user cannot or does not find it convenient to keep typing things and needs a graphical interface, Windows Forms will be more suitable. All of the options offered.

If the application is well done, the processing is so isolated from the interface that it matters nothing and it can be easily exchanged if needed.

If the interface is disrupting the performance of data processing there is something very wrong with the application.

  • 1

    in case there will be no interface, so console will soon work... .

  • 2

    Console is an interface.

  • 1

    interface meant buttons, inputs, etc. but ok..

  • 2

    There you are talking about graphical interface.

2

In this case there is not the fastest and yes how the processing will be done. As there will be no human interaction, use console.

As it is a process that will repeat itself several times, I believe that in a time interval, the interaction with the database (read/write) should be as small as possible, summarizing, to each interaction behind everything, processes and records everything, at once, do not record the record and much less within repeat loops, thus avoiding multiple access to the database. Prepares the entity to be persisted and severe in the bank all at once. Use Entity framework.

  • for academic purposes I will try to migrate the console application to MVC, but I believe that IIS + System.Web are intermediaries that affect performance well, thanks to the tip.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.