[Issue 4447] order of functions greatly affects execution time
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Jul 12 08:58:43 PDT 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4447
Heywood Floyd <soul8o8 at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |soul8o8 at gmail.com
--- Comment #1 from Heywood Floyd <soul8o8 at gmail.com> 2010-07-12 08:58:39 PDT ---
// - - 8< - -
version(one)
{
fooManual(a, b);
fooCompiler(a, b);
fooManual(a, b);
fooCompiler(a, b);
fooManual(a, b);
fooCompiler(a, b);
}
version(two)
{
fooCompiler(a, b);
fooManual(a, b);
fooCompiler(a, b);
fooManual(a, b);
fooCompiler(a, b);
fooManual(a, b);
}
// - - 8< - -
$ dmd -inline -O -release -version=one -run odd
manual: d = 32.000000, BFFFF578 time: 126120
compiler: d = 32.000000, BFFFF578 time: 8200
manual: d = 32.000000, BFFFF578 time: 5920
compiler: d = 32.000000, BFFFF578 time: 5960
manual: d = 32.000000, BFFFF578 time: 5690
compiler: d = 32.000000, BFFFF578 time: 5620
$ dmd -inline -O -release -version=two -run odd
compiler: d = 32.000000, BFFFF578 time: 130200
manual: d = 32.000000, BFFFF578 time: 8140
compiler: d = 32.000000, BFFFF578 time: 5800
manual: d = 32.000000, BFFFF578 time: 5730
compiler: d = 32.000000, BFFFF578 time: 5590
manual: d = 32.000000, BFFFF578 time: 5600
$ _
I can't see that the order of the functions have any impact, rather, the first
couple of 100-thousand CPU ticks the program is not at 100% of its potential
performance. This could be anything, maybe the OS must set some things up for
the first write to stdout, or, the D runtime must do some things, like
expanding the heap for the first allocation etc? I've no idea. Just guessing.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list