Closed Bug 964741 Opened 10 years ago Closed 9 years ago
PJS: consider generalizing scatter to take a function instead of an indices array
In a recent discussion about the PJS parallel method API, jaswanth mentioned that the expense of building the intermediate target indices array to drive scatter was significant. An example here is when you have a large input array A and want to build a (small) histogram of its values. The current scatter API would require that you first build an indices array I where |I.length == A.length|, and then do |A.scatter(I, 0, combine)|, and that means you're building a large intermediate array I. An alternative API would accept a indexing function instead of an array and the indexing function would map each value+index to a target index (probably taking the same arguments that map and filter do). Or perhaps either a function or an array, since we can dispatch on the type.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.