March 30, 2017 Re: The nail in the coffin of C++ or why don't GO there... | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ervin Bosenbacher | On Thursday, 30 March 2017 at 12:27:33 UTC, Ervin Bosenbacher wrote:
> On Thursday, 30 March 2017 at 11:41:46 UTC, rjframe wrote:
>> On Thu, 30 Mar 2017 11:15:10 +0000, Ervin Bosenbacher wrote:
>>
>>> I have already accepted the fact that if
>>> I want to optimize my Python code in certain situations, not all because
>>> you can use better algos, data structures, etc then I have to drop down
>>> to C++ or C using say pybind11. Instead of that D.
>>
>> You can integrate D and Python with pyd.
>>
>> http://code.dlang.org/packages/pyd
>>
>> --Ryan
>
> Brilliant, thank you. Will help to leverage my python code. Also I might be able to convince others around me to use D instead of C extending Python.
Would be nice for you to blog your learning too (nothing fancy, just a quick report from time to time) because many others are in your current situation.
|
March 30, 2017 Re: The nail in the coffin of C++ or why don't GO there... | ||||
---|---|---|---|---|
| ||||
Posted in reply to bachmeier | On Thursday, 30 March 2017 at 13:59:45 UTC, bachmeier wrote:
> On Thursday, 30 March 2017 at 12:27:33 UTC, Ervin Bosenbacher wrote:
>> On Thursday, 30 March 2017 at 11:41:46 UTC, rjframe wrote:
>>> On Thu, 30 Mar 2017 11:15:10 +0000, Ervin Bosenbacher wrote:
>>>
>>>> [...]
>>>
>>> You can integrate D and Python with pyd.
>>>
>>> http://code.dlang.org/packages/pyd
>>>
>>> --Ryan
>>
>> Brilliant, thank you. Will help to leverage my python code. Also I might be able to convince others around me to use D instead of C extending Python.
>
> Would be nice for you to blog your learning too (nothing fancy, just a quick report from time to time) because many others are in your current situation.
I went back to C++ cause integration with existing packages was a pain and a implicit gc
|
March 30, 2017 Re: The nail in the coffin of C++ or why don't GO there... | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ervin Bosenbacher | On Thursday, 30 March 2017 at 11:03:03 UTC, Ervin Bosenbacher wrote: > Tried again, threw in summing up a number 10 million times and repeat the arrays 10 million times, I have used arrays on the stack for the D version. And when I am talking about performance I am curious about CPU bound stuff. > > [...benchmarks snipped...] > > I am still convinced that D is awesome. > Nice! You might also find these benchmarks I did recently interesting: https://github.com/eBay/tsv-utils-dlang/blob/master/docs/Performance.md --Jon |
March 31, 2017 Re: The nail in the coffin of C++ or why don't GO there... | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ervin Bosenbacher | On 3/30/17 1:03 PM, Ervin Bosenbacher wrote:
> On Thursday, 30 March 2017 at 10:28:01 UTC, dennis luehring wrote:
>> Am 30.03.2017 um 08:58 schrieb Ervin Bosenbacher:
>>> That is the same, that came as a shock to me.
>>
>> most compilers (for many languages) can optimize your super-trivial
>> example down to nothing - for at least the last 10 years or more
>>
>> so whats the point? you're talkin about "performance is critical for me"
>> but missing even minor knowledge about todays compiler powers?
>>
>> for a benchmark you need:
>> -loops, running millions of times, preventing IO and do now fall into
>> the completely-optimized-to-nothing-trap etc.
>
> Tried again, threw in summing up a number 10 million times and repeat
> the arrays 10 million times, I have used arrays on the stack for the D
> version. And when I am talking about performance I am curious about CPU
> bound stuff.
>
> The D version:
>
> import std.stdio;
>
> void main()
> {
> long sum = 0;
> foreach (long i; 0 .. 10000000) {
> int[12] months = [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30,
> 31 ];
> int[3] first = months[0 .. 3];
> int[3] second = months[3 .. 6];
> int[3] third = months[6 .. 9];
> int[3] fourth = months[9 .. 12];
>
Most of this code may be easily eliminated by dead-code removal. So you probably just measure the summing loop alone. To be certain look at disassembly.
---
Dmitry Olshansky
|
March 31, 2017 Re: The nail in the coffin of C++ or why don't GO there... | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ervin Bosenbacher | On 03/29/2017 11:58 PM, Ervin Bosenbacher wrote: > From the Programming in D book i typed in the below code In case it's useful to someone, the source code is available in zipped format as well (search for ".zip" on the index page): http://ddili.org/ders/d.en/index.html Ali |
April 01, 2017 Re: The nail in the coffin of C++ or why don't GO there... | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ervin Bosenbacher | On Thursday, 30 March 2017 at 11:03:03 UTC, Ervin Bosenbacher wrote:
> I am still convinced that D is awesome.
As usual, use gdc or ldc for best results, dmd's backend misses lots of optimizations.
|
Copyright © 1999-2021 by the D Language Foundation