What is faster for writing C # (.NET) or PERL files?

We have many old obsolete Perl scripts that connect to MS SQL db, process some records, and create files. Over time, the size of daily transactions has grown, and these scenarios are becoming more and more expensive.

In addition, Databases grew with a large number of tables, and modifying older Perl scripts is cumbersome. Thought of repeating some basic scripts under .NET (in C #)

Is there a speed advantage under a machine running Windows Server using one and the other?

Idea again

  • Execute request

  • Process results through some basic formatting

  • Writing Results to a File

+4
source share
3 answers

Depending on how stupid the respective programmers are. With proper initialization, both of them should be convenient, saturating any bandwidth that you throw at them in the disk system - and this is your bottleneck. Make large cached entries (.NET BufferedStream) and make your SSD or something fast ready. The perforating bottleneck with proper programming is the disk subsystem for this type of work.

+10
source

Both tasks can be performed equally quickly in any language. They can also be done terribly wrong and terribly slow in both languages, so this must be taken into account.

In one of your comments, you will note that you are formatting on the server side of SQL. These requests would potentially be a lot cheaper if you did it from the application side and then moved this script to a faster machine in order to least affect the db server.

I would suggest that hard drive speed is your biggest problem. You must control resources while this script is running - is this maximizing your processor? Is reading / writing a lot in memory? (it should not). Is it just waiting on an i / o drive most of the time? If so, you should consider upgrading your storage to faster drives, raids, or ssd, depending on what matters most to your situation.

Even something like disk defragmentation can help.

If you have good cpu / memory, but you can avoid a slow disk, you can even compile all the output in memory before writing (again, assuming this is a good idea, it really depends on where these reports go and which format is needed).

+1
source

I do not expect big differences between these languages ​​when it comes to recording performance (usually the bottleneck will be the hard drive, not the processor power of the processor). You'd better take a look at the “code maintenance costs”, in C # you can get cleaner code, not to mention the fact that integration with MS SQL is likely to be more efficient, not to mention the fact that you can use threads .

Better code, more convenient, perhaps faster. Yes C # a good idea

-3
source

Source: https://habr.com/ru/post/1392860/


All Articles