digitalmars.D - D postmortem
- Walter Bright (2/2) Jun 22 2008 Unfortunately, the article itself has gone down, but the comments are up...
- Steven Schveighoffer (5/7) Jun 23 2008 The article comes up if you click the link at the top "D Postmortem"
- Robert Fraser (5/8) Jun 23 2008 It was repeated in one of the comments.
- bearophile (19/20) Jun 24 2008 I was reading this thread:
- Walter Bright (3/12) Jun 24 2008 Can you look at the asm output and identify a case where it is less
- bearophile (10/11) Jun 24 2008 You are right, I have cleaned my code up a bit, removing too much silly ...
Unfortunately, the article itself has gone down, but the comments are up: http://www.reddit.com/r/programming/info/6ogl6/comments/
Jun 22 2008
The article comes up if you click the link at the top "D Postmortem" At least *an* article comes up, not sure if thats the one you were talking about :) -Steve "Walter Bright" wroteUnfortunately, the article itself has gone down, but the comments are up: http://www.reddit.com/r/programming/info/6ogl6/comments/
Jun 23 2008
Walter Bright Wrote:Unfortunately, the article itself has gone down, but the comments are up: http://www.reddit.com/r/programming/info/6ogl6/comments/It was repeated in one of the comments. I agree with everything there, except the fact taht no steps are being taken to solve the paralellism problem. D is taking steps, although whether those are the correct steps is a different question entirely.
Jun 23 2008
I was reading this thread: http://www.reddit.com/r/programming/info/6ogl6/comments/ And it contains this: WalterBright:I'm not sure what you're encountering with the struct return code. The D compiler does the named value return optimization, the same as C++. It will also return small structs in registers, as C++ compilers do. If you could email me (or put on bugzilla) an example of the problem, I can comment more.<Stuct/classes usage in DMD is much slower than the same performed in C++ with MinGW. After two days of benchmarks I have found a way that allows enough speed (and later I have written around that solution the tinyvect module you can find in my libs). import d.func: Lets2; struct Vec(TyDato, int n) { TyDato[n] data; void opAddAssign(Vec!(TyDato, n)* other) { mixin( Lets2!("this.data[%s] += other.data[%s];", n) ); } } You have to allocate them like this, with a new: auto v = new Vec!(long, 3); The Lets2!() template generates n assignment lines at compile time, according to the fixed size of the array. Every other way I have tried (about 30 different designs, I think) is 1.3-4 times slower, so if you need such speed you can't use classes, etc. But designing the struct this way doesn't allows to use operation overloading, I think. Bye, bearophile
Jun 24 2008
bearophile wrote:And it contains this: WalterBright:Can you look at the asm output and identify a case where it is less efficient?I'm not sure what you're encountering with the struct return code. The D compiler does the named value return optimization, the same as C++. It will also return small structs in registers, as C++ compilers do. If you could email me (or put on bugzilla) an example of the problem, I can comment more.<Stuct/classes usage in DMD is much slower than the same performed in C++ with MinGW.
Jun 24 2008
Walter Bright:Can you look at the asm output and identify a case where it is less efficient?You are right, I have cleaned my code up a bit, removing too much silly experiments. This is just a first version, if you need something different I'll try to show something different: http://rafb.net/p/TDxobC64.html Its asm: http://rafb.net/p/16MemX81.html The timings at the end are done on a dual core at 2 GHz with DMD V.1.029 (I can't use the two successive versions). I think efficiency losses come from many different sources, so it may be difficult to spot a single small thing to be fixed. (But DMD is a young language, at the beginning Java too was really inefficient, so for now I agree that it's better to focus most work on developing the language. Efficiency issues are mostly for later). Thank you, bearophile
Jun 24 2008