mattasmith/SCHEMA-RASPP — pull request #1 by rmzelle (2013-07-25 02:07:22+00:00)
Title: Change a "range" into an "xrange" in schema.py

Running rasppcurve.py resulted in a Python memory error after I increased the number of crossovers. The culprit was the line `	for i in range(p**n):` in schema.py.

I found an internet discussion where, at least for Python 2.7, the use of “xrange” is recommended over the use of “range”, both for memory and performance reasons. See http://stackoverflow.com/questions/10399818/should-one-use-xrangeiterations-or-a-list-of-leniterations-for-better-perfor . And indeed, using `	for i in range(p**n):` clear the memory error and sped up the program. A quick comparison showed a significant time-saving:

With “range”:

```
# RASPP took 1083.89 secs
# RASPP found 7874 results
# RASPP found 60 unique (,) points
# RASPP curve took 751.87 secs
```

With “xrange”:

```
# RASPP took 611.03 secs
# RASPP found 7874 results
# RASPP found 60 unique (,) points
# RASPP curve took 695.27 secs
```

There are many more instances of "range" in the code, but I haven't yet tested whether replacing them all with "xrange" yields further improvements.