
Benchmarks -- we test reading and writing random numbers up to 2^N

For write-tests:

   FMT    is (format stream "~x" val)
   SAFE   is (fastnumio:write-hex val)
   UNSAFE is (fastnumio:scary-unsafe-write-hex val)

For read-tests:

   READ   is (read stream) where stream has sharp-prefixed numbers
          like #xBEEF.
   SAFE   is (fastnumio:read-hex stream) where stream contains
          whitespace-separated numbers like BEEF

You can run these benchmarks yourself, e.g.:

   ccl < write-hex-benchmark.lsp
   ccl < read-hex-benchmark.lsp     (**NOTE**: writes to /dev/shm!!
                                     edit first if you don't have one)


Results from compute-1-2: Intel(R) Core(TM) i7-3930K CPU @ 3.20GHz
                          Linux compute-1-2.local 2.6.32-431.el6.x86_64


Things to improve:

  - Want unsafe version of read-hex on CCL


Hex Writing -- CCL 1.11-dev-r16363M-trunk

         N         FMT       SAFE/Speedup     UNSAFE/Speedup
---------------------------------------------------------------

        32        5.82s       1.48s/3.95x       1.50s/3.89x
                   7.1K       7.1K  100.0%        7.1K  100.0%

        60        7.56s       2.02s/3.74x       2.02s/3.74x
                   7.1K       7.1K  100.0%        7.1K  100.0%

        64       11.69s       2.90s/4.03x       2.33s/5.03x
                 256.4M     109.9M  42.9%        7.1K  0.0%

        80       10.30s       2.61s/3.95x       2.40s/4.29x
                 274.7M      91.6M  33.3%        7.1K  0.0%

       128       13.84s       3.55s/3.90x       2.89s/4.79x
                 457.8M     228.9M  50.0%        7.1K  0.0%

       256       17.22s       4.05s/4.25x       3.40s/5.07x
                 640.9M     366.2M  57.1%        7.1K  0.0%

       512       23.10s       4.22s/5.48x       3.45s/6.71x
                 885.8M     549.3M  62.0%        7.1K  0.0%

----------------------------------------------------------------



Hex Writing -- SBCL 1.2.10.68-f29079d

         N         FMT       SAFE/Speedup     UNSAFE/Speedup
---------------------------------------------------------------

        32        5.08s       1.40s/3.62x       1.40s/3.62x
                 152.7M      83.8K  0.1%       84.2K  0.1%

        60        8.87s       1.75s/5.07x       1.78s/4.97x
                 152.7M      84.2K  0.1%       84.0K  0.1%

        64        8.07s       4.26s/1.90x       2.07s/3.89x
                 415.1M       1.6G  399.9%       84.2K  0.0%

        80        7.80s       3.19s/2.44x       2.14s/3.65x
                   1.3G       1.2G  91.8%       84.0K  0.0%

       128       10.71s       4.56s/2.35x       2.53s/4.24x
                   3.8G       2.0G  52.5%       84.2K  0.0%

       256       13.16s       5.09s/2.59x       3.00s/4.38x
                   1.6G       2.5G  151.1%       83.8K  0.0%

       512       13.11s       4.98s/2.63x       3.02s/4.35x
                   2.0G       2.7G  138.0%       84.2K  0.0%

----------------------------------------------------------------



Hex Reading -- CCL 1.11-dev-r16363M-trunk

         N        READ       SAFE/Speedup     UNSAFE/Speedup   (note: same as safe, for now)
--------------------------------------------------------------

        32        7.63s       1.59s/4.78x       1.55s/4.92x
                  25.6K      24.1K  94.1%       24.1K  94.1%

        64       10.28s       3.15s/3.27x       3.13s/3.28x
                 252.7M     219.3M  86.8%      219.3M  86.8%

       128       12.37s       3.17s/3.91x       3.18s/3.89x
                   2.5G     304.6M  11.9%      304.6M  11.9%

       512       24.03s       5.07s/4.74x       5.10s/4.71x
                  12.1G     854.5M  6.9%      854.5M  6.9%

--------------------------------------------------------------



Hex Reading -- SBCL 1.2.10.68-f29079d

         N        READ       SAFE/Speedup     UNSAFE/Speedup
--------------------------------------------------------------

        32        3.60s       1.73s/2.08x       1.72s/2.09x
                  85.4K      84.1K  98.4%       83.9K  98.2%

        64        6.79s       3.21s/2.11x       3.11s/2.18x
                 839.5M     286.4M  34.1%      109.8M  13.1%

       128        6.24s       3.03s/2.06x       2.80s/2.23x
                 991.0M     419.0M  42.3%       76.4M  7.7%

       512        8.58s       4.60s/1.87x       4.08s/2.10x
                   1.5G     991.9M  65.7%       76.4M  5.1%

--------------------------------------------------------------
