performance of byte vs. int in .NET

后端 未结 5 641
伪装坚强ぢ
伪装坚强ぢ 2021-01-17 18:49

In pre-.NET world I always assumed that int is faster than byte since this is how processor works.

Now it\'s matter habit of using int even when bytes could work, fo

5条回答
  •  [愿得一人]
    2021-01-17 19:48

    OK, I just opened disassembly window. There is nothing there but regular "mov byte"

    So, .NET/CLR does not add anything to this. And all arithmetic operations done against int values, so no difference between bytes and int there.

提交回复
热议问题