digitalmars.D - Is there a report for performance compared with popular languarge?
- cglee (13/13) Aug 11 2010 Hi,
- Kagamin (3/6) Aug 11 2010 Java has a very good optimizer, so in trivial mathematical tests java's ...
- Pelle (4/17) Aug 12 2010 Last I looked, java is faster than D in some cases, and vice versa.
- bearophile (12/15) Aug 12 2010 Performance comes from many different kinds of optimizations. In modern ...
- Walter Bright (6/9) Aug 13 2010 You get the *same* performance as C. Compare DMD with DMC, for example. ...
- Nick Sabalausky (5/16) Aug 12 2010 http://dotnot.org/blog/archives/2008/03/10/xml-benchmarks-updated-graphs...
Hi, I have used 'C' and 'jav'a for several years. When I need speed, I used 'C'. When I have to reduce implemetation time, I used 'java'. In my view, D language has both merits from 'C' and 'java'. It means that it is OOP, but it generates native binary without VM. We already have C++ as this. But C++ makes me more confused when I use it. Now, I have questions about how much 'D' is fast comparing with 'java' and how much bigger in binary size generated by 'D' comparing with 'C'. Is there anyone has information about this?. Thanks cglee
Aug 11 2010
cglee Wrote:Now, I have questions about how much 'D' is fast comparing with 'java' and how much bigger in binary size generated by 'D' comparing with 'C'. Is there anyone has information about this?.Java has a very good optimizer, so in trivial mathematical tests java's speed is comparable with C. The problem with java is that it uses much more memory, I suppose. On Windows D links C runtime statically and D runtime takes some space too.
Aug 11 2010
On 08/12/2010 05:26 AM, cglee wrote:Hi, I have used 'C' and 'jav'a for several years. When I need speed, I used 'C'. When I have to reduce implemetation time, I used 'java'. In my view, D language has both merits from 'C' and 'java'. It means that it is OOP, but it generates native binary without VM. We already have C++ as this. But C++ makes me more confused when I use it. Now, I have questions about how much 'D' is fast comparing with 'java' and how much bigger in binary size generated by 'D' comparing with 'C'. Is there anyone has information about this?. Thanks cgleeLast I looked, java is faster than D in some cases, and vice versa. D will blow up the size of executables by quite a lot, though. Due to templates and static linking of libraries, mostly.
Aug 12 2010
cglee:Now, I have questions about how much 'D' is fast comparing with 'java' and how much bigger in binary size generated by 'D' comparing with 'C'. Is there anyone has information about this?.Performance comes from many different kinds of optimizations. In modern languages things as: - Partial unrolling of loops even when the number of cycles is not known at compile-time - Inlining, even in presence of virtual calls - If the code performs lot of heap activity (as Java-style code) then a significant percentage of the performance comes from the efficiency of the GC. But today the GPU is used more and more by serious number crunchers. A numerical program written in Python that implements its numerical kernels on good GPUs using PyCuda, PyopenCL, may be tens of times more efficient than average C code written for the CPU (and for numerical kernels on the CPU there is corepy). Intel says that the GPU is on average 2.5 only times faster, but in practice you need to be a Wizard to squeeze that amount of performance from very costly CPUs. If you compile D1 code with LDC you get a good performance, comparable with C or sometimes better. If you use DMD you get lower performance (usually no more than 2-3 times slower) on both FP and integer code. The D GC is not efficient enough yet, so efficient D1/D2 programs need to minimize heap activity, and use stack-allocates structs as much as possible, and avoid Java-style code. Currently D programs use less memory than Java, thanks to structs too, but as D gets a better GC, it will probably use more RAM too. With GCs there is a tradeoff between speed and amount of memory usage. D binary size is larger than C but comparable to C++ code that uses many templates, there is a constant overhead given by statically linked runtime that's bigger than the C++ one (GC, array concat, etc). The more templates you use, the bigger the binary becomes. Phobos uses templates heavily, Tango for D1 uses them less often. Bye, bearophile
Aug 12 2010
bearophile wrote:If you compile D1 code with LDC you get a good performance, comparable with C or sometimes better. If you use DMD you get lower performance (usually no more than 2-3 times slower) on both FP and integer code.You get the *same* performance as C. Compare DMD with DMC, for example. You'll get the same results. LCC vs LDC, you'll get the same results. GCC vs GDC, same results. Comparing DMD with LCC, and GCC vs LDC, etc., tell you the difference between code generators, not between languages.
Aug 13 2010
"cglee" <high_volt hanmail.net> wrote in message news:i3vpkj$1mi3$1 digitalmars.com...Hi, I have used 'C' and 'jav'a for several years. When I need speed, I used 'C'. When I have to reduce implemetation time, I used 'java'. In my view, D language has both merits from 'C' and 'java'. It means that it is OOP, but it generates native binary without VM. We already have C++ as this. But C++ makes me more confused when I use it. Now, I have questions about how much 'D' is fast comparing with 'java' and how much bigger in binary size generated by 'D' comparing with 'C'. Is there anyone has information about this?.http://dotnot.org/blog/archives/2008/03/10/xml-benchmarks-updated-graphs-with-rapidxml/ http://dotnot.org/blog/archives/2008/03/10/xml-benchmarks-parsequerymutateserialize/ http://dotnot.org/blog/archives/2008/03/12/why-is-dtango-so-fast-at-parsing-xml/
Aug 12 2010