Perf

Optimized general speed.

The benchmark of #478 has now on my machine:

    before: 16,252,928 bytes, 3.284 seconds
    after:  12,058,624 bytes, 1.991 seconds