Using D and std.ndslice as a Numpy Replacement

David Nadlinger via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Sun Jan 3 16:24:51 PST 2016


On Sunday, 3 January 2016 at 18:56:07 UTC, Jack Stouffer wrote:
> I still have to disagree with you that the example I submitted 
> was fair. Accessing global memory in D is going to be much 
> slower than accessing stack memory, […]

What leads you to this belief? (Beyond cache locality 
considerations, which are not so important if the data is large.)

> and sense most std.ndslice calculations are going to be on the 
> stack, I believe my benchmark is indicative of normal use.

Your iota example does not read the data from memory at all 
(neither stack nor heap), instead computing it on the fly.

  — David


More information about the Digitalmars-d-announce mailing list