Re: textbook authors: passing by ref is NOT more efficient!
- From: Jon Skeet [C# MVP] <skeet@xxxxxxxxx>
- Date: Tue, 1 Apr 2008 16:14:21 +0100
Cowboy (Gregory A. Beamer) <NoSpamMgbworld@xxxxxxxxxxxxxxxxxx> wrote:
I am not sure what textbook author (or which authors) you are talking about,
so I cannot assess the comment in context. I would agree, overall, with the
blanket statement that passing by ref is "more efficient" if we are seeing
efficiency in terms of performance and we are talking reference objects. If
I run a million iterations, I will see a slight performance benefit by
passing by reference, as I am not allocating memory in many cases.
Why would any more memory be allocated by passing a reference by value
than by passing a reference by reference?
Can you give a complete example which shows this efficiency gain, with
reference types?
--
Jon Skeet - <skeet@xxxxxxxxx>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk
.
- Follow-Ups:
- Re: textbook authors: passing by ref is NOT more efficient!
- From: Cowboy \(Gregory A. Beamer\)
- Re: textbook authors: passing by ref is NOT more efficient!
- From: Cowboy \(Gregory A. Beamer\)
- Re: textbook authors: passing by ref is NOT more efficient!
- References:
- textbook authors: passing by ref is NOT more efficient!
- From: Aaron Watters
- Re: textbook authors: passing by ref is NOT more efficient!
- From: Cowboy \(Gregory A. Beamer\)
- textbook authors: passing by ref is NOT more efficient!
- Prev by Date: Re: textbook authors: passing by ref is NOT more efficient!
- Next by Date: Re: debugging slows down other actions
- Previous by thread: Re: textbook authors: passing by ref is NOT more efficient!
- Next by thread: Re: textbook authors: passing by ref is NOT more efficient!
- Index(es):
Relevant Pages
|