[Issue 12446] std.parallelism.amap prefer iteration to indexing

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Mar 23 15:26:53 PDT 2014


https://d.puremagic.com/issues/show_bug.cgi?id=12446



--- Comment #5 from safety0ff.bugz <safety0ff.bugz at gmail.com> 2014-03-23 15:26:51 PDT ---
(In reply to comment #4)
> ... But there's always a way to test by measuring :o). Try it on a few typical
> ranges. ("Typical" == cost of random access, if offered, shouldn't be onerous.)

It's not typical array-like random access ranges that will benefit, it's
atypical ones where iteration is simple but indexing is non-trivial.

For example, my "triangular" random access range which returns the tuples:
[0, 0], [1, 0], [1, 1], [2, 0], [2, 1], [2, 2], [3, 0], [3, 1], [3, 2], [3, 3]

Iteration is simple, but indexing involves solving a quadratic + some other
operations.

Even though one might not call this "onerous," there is still enough relative
difference for it to be noticeable.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list