Commenting out a print slows my code?

2011-03-09 Thread Charles McAnany
Hi, all. I'm in college, taking a freshman-level CS class. (I'm actually a senior chemist with free time.) Anyhoo, the warm-up assignment was Hardy Taxi problem, phrased like this: [Exposition removed.] 1729 is the smallest number such that for (a!=b!=c!=d)>0, there exists a combination of a, b, c,

Re: Commenting out a print slows my code?

2011-03-09 Thread Jesse Phillips
Charles McAnany Wrote: > (There's also a StopWatch timing things, and isTaxiNumber returns a struct, > not a bool. See attached code.) > This code runs in about 0.09 seconds. > If I comment out the writefln, it takes 0.11 seconds. > (These are collected from about 20 runs of each. Times are very c

Re: Commenting out a print slows my code?

2011-03-10 Thread spir
On 03/10/2011 01:44 AM, Charles McAnany wrote: Hi, all. I'm in college, taking a freshman-level CS class. (I'm actually a senior chemist with free time.) Anyhoo, the warm-up assignment was Hardy Taxi problem, phrased like this: [Exposition removed.] 1729 is the smallest number such that for (a!=b

Re: Commenting out a print slows my code?

2011-04-01 Thread vincent feltkamp
I managed to get the file, and even compile it, but apparently the type Ticks doesn't exists any more, it is now (DMD2.052) TickDuration, with methods TickDuration.seconds (msecs, hnsecs, ...). on my computer, it does not generate slower code without the writeln than with. ( .38-.39 secs with, .