Which is faster call by value or call by reference ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Which is faster call by value or call by reference ?

15th Jun 2017, 12:49 PM
Master Gaurav
Master Gaurav - avatar
2 Answers
+ 2
Call by reference in some, both equally fast to execute in others... It all depends on the code inside... In new compilers though, this difference is in the matter of milliseconds...
15th Jun 2017, 2:24 PM
Kinshuk Vasisht
Kinshuk Vasisht - avatar
+ 2
For small amounts of data value is faster. For structs and classes that arent small, reference is faster
15th Jun 2017, 3:03 PM
aklex
aklex - avatar