On Fri, 27 Apr 2012 11:33:39 -0400, Joseph Rushton Wakeling <joseph.wakel...@webdrake.net> wrote:

On 27/04/12 17:18, Steven Schveighoffer wrote:
const should not affect code generation *at all*, except for name mangling (const MyStruct is a different type from MyStruct), and generating an extra TypeInfo for const MyStruct and const MyStruct[]. Const is purely a compile-time
concept.

This cannot account for an extra 2 seconds. Something else is happening.

Without more of your code, nobody can give a definitive answer except it is not
supposed to affect it.

The code is here: https://github.com/WebDrake/Dregs/

... and the particular file concerned is
https://github.com/WebDrake/Dregs/blob/master/dregs/codetermine.d

You'll see that there are about 8 different functions in there which receive as input an array of type Rating!(UserID, ObjectID, Reputation)[]. These were the inputs I was marking as const.

Hm.. you have marked all your functions pure as well. I don't think this will affect anything in the current implementation, but it might. However, I'd expect the opposite (const version is faster) if anything.

-Steve

Reply via email to