August 18, 2013 Re: Is D the Answer to the One vs. Two Language High ,Performance Computing Dilemma? | ||||
---|---|---|---|---|
| ||||
Posted in reply to John Colvin | On Sunday, 18 August 2013 at 18:26:13 UTC, John Colvin wrote:
> On Sunday, 18 August 2013 at 18:08:58 UTC, Dicebot wrote:
>>> Yes, in limited circumstances if you write D like you would write C, you can get comparative performance.
>>
>> I'd say in all cases when you mimic C behavior in D one should expect same or better performance with ldc/gdc unless you hit a bug.
>
> array literal allocations. I guess that's debatably a performance bug.
I have said "C behavior", not "C syntax". That is the main problem with comparing _language_ performance - stick to same semantics and you are likely to get same performance but it may require quite inconvenient coding style (i.e. working around array literals is a huge pain). So probably it makes more sense to compare idiomatic code. But where are the limits?
It is a bit easier with vm-based languages because performance of vm implementation itself does matter and can be compared. Compiled languages with same backend? No idea how to benchmark those properly.
When people expect to get a performance gain from simply using certain language, it just can't end good.
|
August 18, 2013 Re: Is D the Answer to the One vs. Two Language High ,Performance Computing Dilemma? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Timon Gehr | On Sunday, 18 August 2013 at 18:31:17 UTC, Timon Gehr wrote:
> I guess that's debatably mimicking C behaviour.
What behavior do you refer to?
|
August 19, 2013 Re: Is D the Answer to the One vs. Two Language High ,Performance Computing Dilemma? | ||||
---|---|---|---|---|
| ||||
On Sun, Aug 18, 2013 at 09:26:45AM +0100, Russel Winder wrote: > On Sun, 2013-08-18 at 01:59 -0400, John Joyus wrote: > > On 08/11/2013 04:22 AM, Walter Bright wrote: > > > http://elrond.informatik.tu-freiberg.de/papers/WorldComp2012/PDP3426.pdf > > > > This article claims the "Performance [of D] is equivalent to C". > > > > Is that true? I mean even if D reaches 90% of C's performance, I still consider it great because of its productive features, but are there any benchmarks done? > > Not a statistically significant benchmark but an interesting data point: > > C: > > ==================== Sequential > pi = 3.141592653589970752 > iteration count = 1000000000 > elapse time = 8.623442 > > C++: > > ==================== Sequential > pi = 3.14159265358997075 > iteration count = 1000000000 > elapse = 8.61212399999999967 > > D: > > ======================== pi_sequential.d > π = 3.141592653589970752 > iteration count = 1000000000 > elapse time = 8.612256 > > > C and C++ were compiled with GCC 4.8.1 full optimization, D was compiled with LDC full optimization. Oh go on, let's do it with GDC as well: > > ======================== pi_sequential.d > π = 3.141592653589970752 > iteration count = 1000000000 > elapse time = 8.616558 > > > And you are going to ask about DMD aren't you :-) > > ======================== pi_sequential.d > π = 3.141592653589970752 > iteration count = 1000000000 > elapse time = 9.495549 > > Remember this is 1 and only 1 data point and not even a sample just a single data point. Thus only hypothesis building is allowed, no deductions. But I begin to believe that D is as fast as C and C++ using GDC and LDC. DMD is not in the execution performance game. [...] This may be merely only a single isolated data point, but it certainly matches my experience with GDC / DMD. I find that gdc -O3 consistently produces code that outperforms code produced by dmd -O -inline -release. As for comparison with C/C++, I haven't really tested it myself so I can't say. But I *will* say that it's far easier to write casual code (i.e., not hand-tuned for performance) in D that has similar performance to the C/C++ equivalent. T -- Microsoft is to operating systems & security ... what McDonalds is to gourmet cooking. |
August 19, 2013 Re: Is D the Answer to the One vs. Two Language High ,Performance Computing Dilemma? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dicebot | On Sunday, 18 August 2013 at 18:33:05 UTC, Dicebot wrote:
> ...
> When people expect to get a performance gain from simply using certain language, it just can't end good.
Specially because they tend to do the common fallacy of comparing languages instead of implementations.
|
August 19, 2013 Re: Is D the Answer to the One vs. Two Language High ,Performance Computing Dilemma? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Iain Buclaw | On Sunday, 18 August 2013 at 17:28:16 UTC, Iain Buclaw wrote:
> On 18 August 2013 18:24, ProgrammingGhost
> <dsioafiseghvfawklncfskzdcf@sdifjsdiovgfdisjcisj.com> wrote:
>> On Sunday, 11 August 2013 at 18:25:02 UTC, Andrei Alexandrescu wrote:
>>>
>>> For a column of text to be readable it should have not much more than 10
>>> words per line. Going beyond that forces eyes to scan too jerkily and causes
>>> difficulty in following line breaks.
>>
>>
>> This.
>> Also some people can read a line a second because they read downward instead
>> of left to right. Although I heard this through hearsay
>
> Probably more like two lines at once, if they are reading a book.
> Reading code? I reckon you can read downwards on that. :)
Is it true? Are you able to read a line (or two) at once?
|
August 19, 2013 Re: Is D the Answer to the One vs. Two Language High ,Performance Computing Dilemma? | ||||
---|---|---|---|---|
| ||||
Posted in reply to ProgrammingGhost | On Monday, 19 August 2013 at 22:16:39 UTC, ProgrammingGhost wrote:
> Is it true? Are you able to read a line (or two) at once?
I have been doing it since early school days and was quite surprised to find out later that it is not the common case. Well, when reading technical literature I often come back and re-read some intense paragraphs carefully word-by-word but it is more like fallback.
And yes, I do try to organize the code in such way that going quickly up-down through it is possible.
|
Copyright © 1999-2021 by the D Language Foundation