Making it simple wasn’t simple



I started working on this project in December. Months later and, for certain values of the word “done,” it’s done. All this time, I’ve been building tools to make implementing various and sundry experiments easy, or at least, easier. Now that I have my tools, let’s play with them.

In a previous post, “Making it simple isn’t simple,” I’d noticed that the precoded Tiera style ancestor figures were running much slower than the amoeba style randomly generated ones. Both populations are stable. They reproduce, without the population ever dying out completely, but the precoded ones take much longer to do it. According to the numbers recorded in the earlier post, the precoded figures are taking 118% longer to have the same number of children as the randomly generated ones. That’s more than twice as much time!

Why?

Here’s some output of a test I wrote, to figure out what the different populations were up to.

One child:

precoded
report
Longest=1, 22 gets, 11 sets
Cycles=6
port calls=33
Random calls=6
instructions=11
0 at 0 set command=63 port=-33
1 at 1 set command=1 port=-17
null
Elapsed time=0 hours, 0 minutes and 0 seconds

random
report
Longest=1, 8 gets, 7 sets
Cycles=5
port calls=15
Random calls=0
instructions=9
0 at 0 set command=64 port=-33
1 at 1 set command=-64 port=-13
null
Elapsed time=0 hours, 0 minutes and 0 seconds

Two children:

precoded
report
Longest=2, 43 gets, 21 sets
Cycles=11
port calls=64
Random calls=9
instructions=22
null
1 at 1 set command=-66 port=-35
2 at 2 set command=69 port=-33
Elapsed time=0 hours, 0 minutes and 0 seconds

random
report
Longest=2, 17 gets, 13 sets
Cycles=9
port calls=30
Random calls=0
instructions=18
null
1 at 1 set command=49 port=-15
2 at 2 set command=64 port=-33
Elapsed time=0 hours, 0 minutes and 0 seconds

Three children:

precoded
report
Longest=3, 66 gets, 32 sets
Cycles=17
port calls=98
Random calls=12
instructions=34
3 at 0 set command=72 port=-33
null
2 at 2 set command=-3 port=-14
Elapsed time=0 hours, 0 minutes and 0 seconds

random
report
Longest=3, 25 gets, 19 sets
Cycles=14
port calls=44
Random calls=0
instructions=28
3 at 0 set command=64 port=-33
null
2 at 2 set command=0 port=-17
Elapsed time=0 hours, 0 minutes and 0 seconds

100 children, and we lived in a shoe!

precoded
report
Longest=100, 2297 gets, 1099 sets
Cycles=599
port calls=3396
Random calls=303
instructions=1198
99 at 0 set command=-3 port=-14
100 at 1 set command=363 port=-33
null
Elapsed time=0 hours, 0 minutes and 0 seconds

random
report
Longest=100, 801 gets, 601 sets
Cycles=499
port calls=1402
Random calls=0
instructions=998
99 at 0 set command=0 port=-17
100 at 1 set command=64 port=-33
null
Elapsed time=0 hours, 0 minutes and 0 seconds

As you can see, the precoded figures are executing far more instructions to produce a given number of offspring. The precoded population, somewhat ironically, also calls the pseudorandom number generator, while the random population doesn’t. Pseudorandom number generation is notoriously resource intensive.

Now, just for fun, have a look at one more run. This is a really slow population produced randomly.

100 slow children:
report
Longest=100, 45818 gets, 34161 sets
Cycles=23000
port calls=79979
Random calls=0
instructions=45628
null
100 at 1 set command=50 port=-34
null
Elapsed time=0 hours, 0 minutes and 0 seconds

Obviously, random emergence doesn’t always make for the fastest self replication. That particular population is taking approximately 45 times as much effort to produce the same number of offspring as the other random population.

And all of this was done with small changes to one spot in one file. It’s just so much simpler now.


Leave a Reply