www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - D's performance.

reply Jowei Dei <1365873325 qq.com> writes:
I am curious about the performance of D language as a production 
tool, compared with C and C + + these lower level languages will 
be slower? Can you provide some parameters for comparison? thank 
you.
Jun 30
next sibling parent reply Dukc <ajieskola gmail.com> writes:
On Tuesday, 30 June 2020 at 14:26:02 UTC, Jowei Dei wrote:
 I am curious about the performance of D language as a 
 production tool, compared with C and C + + these lower level 
 languages will be slower? Can you provide some parameters for 
 comparison? thank you.
This article is biased towards D, but still illustrates why we tend to favor it: https://seb.wilzba.ch/b/2018/02/the-expressive-c17-coding-challenge-in-d/
Jun 30
parent reply Jowei Dei <1365873325 qq.com> writes:
On Tuesday, 30 June 2020 at 14:33:46 UTC, Dukc wrote:
 On Tuesday, 30 June 2020 at 14:26:02 UTC, Jowei Dei wrote:
 I am curious about the performance of D language as a 
 production tool, compared with C and C + + these lower level 
 languages will be slower? Can you provide some parameters for 
 comparison? thank you.
This article is biased towards D, but still illustrates why we tend to favor it: https://seb.wilzba.ch/b/2018/02/the-expressive-c17-coding-challenge-in-d/
Thank you for your information. It seems that the performance of D is not very bad compared with low-level languages. It may be between C and Java or. Net. As a normal production tool, there should be no problem. Thank you for your reply. Best regards
Jun 30
parent reply bachmeier <no spam.net> writes:
On Tuesday, 30 June 2020 at 14:46:32 UTC, Jowei Dei wrote:
 On Tuesday, 30 June 2020 at 14:33:46 UTC, Dukc wrote:
 On Tuesday, 30 June 2020 at 14:26:02 UTC, Jowei Dei wrote:
 I am curious about the performance of D language as a 
 production tool, compared with C and C + + these lower level 
 languages will be slower? Can you provide some parameters for 
 comparison? thank you.
This article is biased towards D, but still illustrates why we tend to favor it: https://seb.wilzba.ch/b/2018/02/the-expressive-c17-coding-challenge-in-d/
Thank you for your information. It seems that the performance of D is not very bad compared with low-level languages. It may be between C and Java or. Net. As a normal production tool, there should be no problem. Thank you for your reply. Best regards
Not sure what you mean by drawing a distinction between D and low-level languages. If you translate a piece of C code into D (it doesn't even require much translation since the syntax is similar) and compile it, you'll get the performance of C. If D code is slower than C, it's because you've chosen to write slower code for convenience/safety reasons rather than performance.
Jun 30
parent reply Jowei Dei <1365873325 qq.com> writes:
 Not sure what you mean by drawing a distinction between D and 
 low-level languages. If you translate a piece of C code into D 
 (it doesn't even require much translation since the syntax is 
 similar) and compile it, you'll get the performance of C. If D 
 code is slower than C, it's because you've chosen to write 
 slower code for convenience/safety reasons rather than 
 performance.
I want to use d to develop my own DSL, which requires the performance guarantee of the original language to avoid the performance loss of the upper DSL. In addition, I don't want to implement an extremely complex garbage collector by myself, so I want to find a language with automatic collection function. After comprehensive consideration, I still think that D is very suitable in this respect. It is not cumbersome, fast, and the basic library is relatively complete.
Jun 30
parent Guillaume Piolat <first.name gmail.com> writes:
On Tuesday, 30 June 2020 at 15:13:15 UTC, Jowei Dei wrote:
 I want to use d to develop my own DSL, which requires the 
 performance guarantee of the original language to avoid the 
 performance loss of the upper DSL. In addition, I don't want to 
 implement an extremely complex garbage collector by myself, so 
 I want to find a language with automatic collection function. 
 After comprehensive consideration, I still think that D is very 
 suitable in this respect. It is not cumbersome, fast, and the 
 basic library is relatively complete.
In optimized settings, D doesn't have bounds checks or integer overflow checks, it can easily be the very same performance as C and C++. You can use AMD CodeXL / Intel Amplifier and all kinds of profilers like you would in C++.
Jun 30
prev sibling parent Walter Bright <newshound2 digitalmars.com> writes:
On 6/30/2020 7:26 AM, Jowei Dei wrote:
 I am curious about the performance of D language as a production tool,
compared 
 with C and C + + these lower level languages will be slower? Can you provide 
 some parameters for comparison? thank you.
If you write the same code in the same way, you'll get identical performance between C, C++, and D. Note that they use the same optimizers and back ends.
Jun 30