Updated getIndex() for 650% speed improvement in number breeding program.
authorAaron Taylor <ataylor@subgeniuskitty.com>
Sat, 15 May 2021 10:40:13 +0000 (03:40 -0700)
committerAaron Taylor <ataylor@subgeniuskitty.com>
Sat, 15 May 2021 10:40:13 +0000 (03:40 -0700)
commitc3b4805541f68c1dccc4e7007fdb7c828bb86f8f
tree190b377502a70f2fd27f72b69711fb1bfba24f62
parent7a986617de3ef35f23402db1b507c57ca1879cfb
Updated getIndex() for 650% speed improvement in number breeding program.

Added 'value' field to number based on conjectures related to addition. See my
chapter 2 and 3 notes. This allowed a binary search of the universe rather than
a linear search.

Benchmarking command:
    time ./ch1-breeding-numbers -generations 13 -silent

Before:
    382.156u 3.945s 5:41.96 112.9%  0+0k 40+66io 7pf+0w

After:
    59.828u 3.247s 0:30.70 205.4%   0+0k 1+0io 0pf+0w
chapter-1-experiments/ch1-breeding-numbers.go