How fast is VB.net compared to native arithmetic code?

I need to write software that will do a lot of math. Basically it will be a matrix multiplication with integers to calculate DCT. How much faster should I expect code to work in native c compared to VB.Net? Factor 2, coefficient 10, coefficient 1000 ...? Did someone try and collect statistics about this?

+3
source share
3 answers

.NET code is compiled into native code by the JIT compiler, so you get native code in both cases.

The difference is that C code has slightly lower overhead around computing, so you might expect a difference in factor 2 performance.

0
source

. Pure code is JIT-compiled into native code before execution, so it should not be slower than native code. I would expect 10.

In addition, adaptive optimization methods determine the code when it is run, receiving more information than a typical static compiler. In this way, JIT can make better decisions for further optimization.

+1
source

VB 93,7% C. .

, " " malloc() free(), Gargage, , VB.Net, . GC 10 , mallocs .

C, , , , . VB, . , GC .

/, , , , , . , , , , .

, , . (2 HT CPU) . - "Mark-Taken-And-Get-Data-If-Not-Taken". , . , , , , . , , . , . .

0
source

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


All Articles