Hi,
Interesting question, so I took your examples and made them do
the same thing with regards to allocation (using malloc instead
of new in both languages).
I removed the stopwatch to use "time" instead.
Now the programs should do the very same thing. Will they be as
fast too?
D code:
--
On Thursday, 22 September 2016 at 16:09:49 UTC, Sandu wrote:
It is often being claimed that D is at least as fast as C++.
Now, I am fairly new to D. But, here is an example where I want
to see how can this be made possible.
So far my C++ code compiles in ~850 ms.
While my D code runs in about
On Thursday, 22 September 2016 at 16:09:49 UTC, Sandu wrote:
const int n = 252;
double[] call = new double[n+1];
...
//delete call; // since D is has a garbage collector,
explicit deallocation of arrays is not necessary.
If you care about speed, better unco
On Thu, Sep 22, 2016 at 04:09:49PM +, Sandu via Digitalmars-d-learn wrote:
> It is often being claimed that D is at least as fast as C++.
> Now, I am fairly new to D. But, here is an example where I want to see
> how can this be made possible.
>
> So far my C++ code compiles in ~850 ms.
> Whil
On Thursday, 22 September 2016 at 16:09:49 UTC, Sandu wrote:
It is often being claimed that D is at least as fast as C++.
Now, I am fairly new to D. But, here is an example where I want
to see how can this be made possible.
So far my C++ code compiles in ~850 ms.
While my D code runs in about
On Thursday, 22 September 2016 at 16:09:49 UTC, Sandu wrote:
It is often being claimed that D is at least as fast as C++.
Now, I am fairly new to D. But, here is an example where I want
to see how can this be made possible.
So far my C++ code compiles in ~850 ms.
I assume you meant that it r
It is often being claimed that D is at least as fast as C++.
Now, I am fairly new to D. But, here is an example where I want
to see how can this be made possible.
So far my C++ code compiles in ~850 ms.
While my D code runs in about 2.1 seconds.
The code translated in D looks as follows (can't