Is System.Int32 slower than using int?

Possible duplicate:
C #, int or Int32? I do not care?

A couple of questions on System.Int32:

  • Is there any specific technical reason why sizeof (System.Int32) is not allowed?
  • How fast or slow is System.Int32 compared to int?
  • Calling System.Runtime.InteropServices.Marshal.SizeOf for a variable of type System.Int32 results in 4; how it works? Will the size of this class be exactly the same as the int inside?
+3
source share
1 answer

Effectively there is no difference.

int == Int32.

The first is implicitly 32 bits, while Int32 talks about it, similarly Int64 and Int16 (long and short) do the same.

+4
source

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


All Articles