Hi --

I am not an expert on iterators, but many of the other Chapel group members are 
busy preparing for http://chapel.cray.com/CHIUW2017.html, so I’ll have a go at 
a response and if it needs improving surely someone else will help.

Are you talking about removing the if-stmt in these() and replacing it with the 
body of the else-branch? Yes, conceptually this would be equivalent, but we’d 
end up with the iterator in these() re-yielding what the iterator in 
these_help() yielded, and my guess is that our iterator inlining isn’t quite 
good enough to remove all the overhead in this case.  So to optimize the common 
case, we handle rank==1 specially in these().

greg


On May 29, 2017, at 12:38 AM, Tomsy Paul 
<[email protected]<mailto:[email protected]>> wrote:

Dear all,

I have a doubt regarding 'these' and 'these_help' iterators (line 181 and 151 
respectively) in class DefaultRectangularDom of DefaultRectangular.chpl.

'these' yields directly for rank == 1 and calls 'these_help' otherwise. Now in 
the latter, the condition rank == d is checked at the beginning. So can't we 
avoid the condition rank == 1 in 'these' and directly call 'these_help(rank)' ?
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org<http://Slashdot.org>! 
http://sdm.link/slashdot_______________________________________________
Chapel-developers mailing list
[email protected]<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/chapel-developers

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Chapel-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-developers

Reply via email to