Let's say I have a structure:
struct MyStruct { public int X public int Y }
And a method in some class that repeats many times elsewhere:
public bool MyMethod( MyStruct myStruct ) { return ... }
Does MyMethod Signature Change to Acceptable Optimization?
public bool MyMethod( ref MyStruct myStruct )
If so, how much would this be an advantage? If not, how many fields would the structure need for a sufficiently large advantage, using refthis way?
ref
Since you have clearly asked the question, is this acceptable ...
. ref, ; ref .NET() , .
, , "" ( ...). ?
( . - !).NET . ++.
, 8 4 32- . , 64- . /, , , .
, . , MyMethod .
, , MyMethod, , , , , - .
, . 64- , . 32- . , , . , , ymmv.
, 16 . , , . , , , ( , ), . . , .
int , , . .
int
Int, . , , , .
, : . , - - , (: XNA) -. GC , ( ) .
, , , ref " " ( .NET , , XNA ). , , , - .
; , . x86 vs x64 - , . , ref , , , JIT - , "ldloc" /stloc ", . .
Source: https://habr.com/ru/post/1747048/More articles:JQuery + AJAX + ASP.Net + WebForms - jqueryHow to make text in UITableViewCell wordwrap? - objective-cWhy doesn't Django testrunner find the tests I created? - pythonHow to check if two hosts match - networkingIs it possible to assign a test result to a boolean variable in Java? - javaStoring date and time in a database? - sqlMutithreading in Win32 - multithreadingРазрешить вставку на листе без перезаписи заблокированных ячеек - vbahttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1747052/free-tools-tips-to-assist-me-in-filling-out-forms-on-win7&usg=ALkJrhjKgM-25CEbN0y5JDnnMmQNb8-3dQhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1747054/change-nils-to-zeroes-in-elisp&usg=ALkJrhgJjHO_zKdL42WaLNeKDIZFapc0fgAll Articles