About ref used for performance reasons with struct
Steven Schveighoffer
schveiguy at yahoo.com
Mon Feb 11 08:51:22 PST 2013
On Mon, 11 Feb 2013 10:08:52 -0500, deadalnix <deadalnix at gmail.com> wrote:
> A good rule of thumb to know when to pass by ref for perf is :
> - The struct is big, or contains mixed entities (floats and ints).
> 2*size_t seems like a good heuristic from my experience.
Array slices are 2*sizeof(size_t). I would expect them to be always
copied and not ref'd.
-Steve
More information about the Digitalmars-d
mailing list