chapel-lang/chapel — pull request #709 by bradcray (2014-10-30 00:54:45+00:00)
Title: Nbody speed improvements

[trivial, not reviewed]

Several of Albert's nbody variations have been timing
out on memleaks testing since being moved to a
(slower?) virtual machine. This gives a good excuse
to speed up some of the slower ones that remain
interesting.

The meat of the changes included:

* pulling out some zippered iterators (which have
proven slower than ideal in other cases) and
replaced them with domain/range iterations
and random access

* avoided the use of array slicing in the inner loop

* used 'refvar' declarations to capture references
to the bodies in question instead of the previous
two idioms.

This seems to reduce execution time by about 50%.

While here, I also did some cleanup:

* For all the tests, I reformatted them to not use such
crazy wide indentation in favor of 2-space indentation.

* While here, I also made 'do {' idioms into simply '{'

* Also did a bit of reformatting of the bodies: removed
TAB characters and got rid of some needlessly blank
lines.