C# out parameter performance

后端 未结 6 1650
执笔经年
执笔经年 2020-12-14 16:25

Do out parameters in C# have any performance implications I should know about? (Like exceptions)

I mean, is it a good idea to have

6条回答
  •  眼角桃花
    2020-12-14 17:18

    Out parameters are passed by ref. So only a pointer passed on the stack.

    If your value type is large, there is less copy, but then you have to dereference the pointer on each variable use.

提交回复
热议问题