Compiler as dll

Sandeep Kakarlapudi sandeep.iitkgpspammenot at gmail.com
Wed Jan 28 05:54:49 PST 2009


BCS Wrote:

> Reply to Sandeep,
> 
> > I have been wishing for something similar though for different
> > reasons. Often I have code (in C++) that is executed for a large
> > amount of data like in stream programming and becomes a major hotspot
> > for the application. Think software graphics pipelines. Further, this
> > code has lots of branches and since its executed over many elements
> > they are essentially branches in inner-loops. The values over which
> > they branch are unknown till runtime and the number of combinations of
> > the values can be very very high. Here are the basic attempts to solve
> > that I'm aware of and the problems with each:
> > 
> 
> One option you could use under GCC would be to build all the inner control 
> structures out of gotos and use goto variables that are set outside the loop. 
> I'm not sure how dynamic gotos stack up with conditional jumps but you would 
> still avoid the tests.
> 

Nice idea. While it still won't have optimal peformance, it definitely is another option to use. It gets rid of code bloat, but it comes at the cost of readability and hence maintainability. But I think none of these would come close to the having a run time optimizer to perform code specialization. Often the small latency in optimizing the code is well worth its result. 



More information about the Digitalmars-d mailing list