Console, WindowsForm or MVC which is the fastest for heavy loads?

4

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

  • Query in the database (some milliseconds)
  • For each record, you will execute 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 response from What's the difference between async, multithereading, parallelism, and concurrency? to know some differences between asynchronous processes.

But on which platform would you run faster? imagining that everyone would have a simple, performance-focused layout 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 intermediary layer that would be IIS.

But is there something that asp.web has to help?

NOTE: The software does not need human interaction, it will not require clicks, nothing.

    
asked by anonymous 08.10.2016 / 02:13

3 answers

5

If it is a totally uninteresting program, you 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 re-add as necessary.

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

    
08.10.2016 / 18:54
2

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

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

If the application is well done, processing is so isolated from the interface that it does not matter at all and it can be easily changed if needed.

If the interface is hindering the performance of data processing, something is wrong with the application.

    
08.10.2016 / 02:41
2

In this case there is not the fastest but rather how the processing will be done. Since 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, with each interaction after everything, processes and record everything at once, do not register the record and much less within repetition loops, thus avoiding multiple accesses to the database. It prepares the entity to be persisted and tapes the bank all at once. Use entity framework.

    
08.10.2016 / 04:02