June 15, 2002 Re: computing compile-time constants | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sean L. Palmer | Reading the rest of this thread has given me an absurd idea... Could the D compiler have a switch which turned on performance analysis code within a build, say -analyze. Then when the program is run, call to each function, (or at least those marked inline or whatever) is logged. Then The D compiler can be run with a second switch (-inline perhaps) that reads the performance log and uses it to decide which functions are used enough that inlining them might give a performance enhancement... Two switches are better that one, because then you could performance monitor an inlined function and refine the inlining model... Did that make sense??? Probably not, and it sounds like hard work to me... Alix Pexton... |
June 15, 2002 Re: computing compile-time constants | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sean L. Palmer | "Sean L. Palmer" <seanpalmer@earthlink.net> wrote in message news:aef16u$2ee1$1@digitaldaemon.com... > Because what *YOU* the compiler vendor think is an "acceptable" threshold for how simple it should be, may be too low, or too high. In my experience > it's too low; what I think is simple (say, an empty constructor or one that > initializes a 4x4 matrix with identity) may be "too much" for the poor compiler to allow to be inlined. A few critical sections of code may need inlining even though they exceed that arbitrary limit. Sometimes, especially with later optimization and constant folding, sometimes the entire function just optimizes away, but the compiler wouldn't know that until it tried. I would err on the side of inlining too much, since RAM is > cheap and code caches are too small anyway. > > Maybe if there is an inlining switch it could have a range setting, from low > to high and in between. However even "high" may not be enough in some situations. So some quanta may be necessary. > > Sean I was envisioning a "speed" or "space" optimization setting. The "speed" one would inline larger functions, the "space" would only inline if the result was expected to reduce eventual code size. I understand that this 2 position switch isn't optimal. |
June 15, 2002 Re: computing compile-time constants | ||||
---|---|---|---|---|
| ||||
Posted in reply to Alix Pexton | At least the first part is done by the Digital Mars trace dynamic profiler! "Alix Pexton" <Alix@seven-point-star.co.uk> wrote in message news:01c21477$aff61900$77087ad5@jpswm... > Reading the rest of this thread has given me an absurd idea... > > Could the D compiler have a switch which turned on performance analysis > code within a build, say -analyze. > Then when the program is run, call to each function, (or at least those > marked inline or whatever) is logged. > Then The D compiler can be run with a second switch (-inline perhaps) that > reads the performance log and uses it to decide which functions are used > enough that inlining them might give a performance enhancement... > > Two switches are better that one, because then you could performance monitor an inlined function and refine the inlining model... > > Did that make sense??? > > Probably not, and it sounds like hard work to me... > > Alix Pexton... |
June 17, 2002 Re: computing compile-time constants | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | I notice that your not ruling out, implementing the second part <g>... Walter <walter@digitalmars.com> wrote in article <aeg2in$df2$2@digitaldaemon.com>... > At least the first part is done by the Digital Mars trace dynamic profiler! > > > Could the D compiler have a switch which turned on performance analysis > > code within a build, say -analyze. > > Then when the program is run, call to each function, (or at least those > > marked inline or whatever) is logged. > > Then The D compiler can be run with a second switch (-inline perhaps) that > > reads the performance log and uses it to decide which functions are used > > enough that inlining them might give a performance enhancement... > > > > Two switches are better that one, because then you could performance monitor an inlined function and refine the inlining model... |
June 18, 2002 Re: computing compile-time constants | ||||
---|---|---|---|---|
| ||||
Posted in reply to Alix Pexton | Never say never! "Alix Pexton" <Alix@seven-point-star.co.uk> wrote in message news:01c215eb$42a4f540$f2517ad5@jpswm... > I notice that your not ruling out, implementing the second part <g>... > > Walter <walter@digitalmars.com> wrote in article <aeg2in$df2$2@digitaldaemon.com>... > > At least the first part is done by the Digital Mars trace dynamic > profiler! > > > > > Could the D compiler have a switch which turned on performance analysis > > > code within a build, say -analyze. > > > Then when the program is run, call to each function, (or at least those > > > marked inline or whatever) is logged. > > > Then The D compiler can be run with a second switch (-inline perhaps) > that > > > reads the performance log and uses it to decide which functions are > used > > > enough that inlining them might give a performance enhancement... > > > > > > Two switches are better that one, because then you could performance monitor an inlined function and refine the inlining model... > |
Copyright © 1999-2021 by the D Language Foundation