Again struct initialization

Daniel Keep daniel.keep+lists at gmail.com
Sat Dec 23 15:45:27 PST 2006


Leopold Walkling wrote:
> I've asked for this once but I didn't get satisfieing answers. My 
> problem is this static opCall; I had to use the profiler in order to 
> find the fastes implementation:
> the static keyword makes the creation of the return struct up to 200 
> times slower! I used obj2asm and the profiler to find out that the 
> creation of the internal return value isn't "optimized away" at all.
> 
> Another thing that hurts is that an easy operation like 
> assignment/cast/initialization to a struct have to be implemented 
> through an opCall; Why do I have to assign each value manually to a 
> struct (if I don't/can't implement a static opCall)
> 
> merry christmas!
> Leo

Just a quick question: what compiler flags did you use, and what code 
did you use?  I did some analysis on generated code a while back, and 
the different compiler flags produced wildly varying results.

(Also: obj2asm?  You're lucky.  I had to use ndisasmw and magic numbers 
littered through the code :3)

	-- Daniel



More information about the Digitalmars-d mailing list