Skip to content

Commit

Permalink
More tuning and updated benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
catid committed Apr 20, 2018
1 parent a573f8b commit 89c02d7
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 80 deletions.
172 changes: 100 additions & 72 deletions README.md
Expand Up @@ -172,82 +172,110 @@ To run the test yourself just build and run the UnitTest project in Release mode
For small values of N < 128 or so this is a pretty inefficient codec compared to the Fecal codec. Fecal is also a fountain code but is limited to repairing a small number of failures or small input block count.

~~~
For N = 12 packets of 1300 bytes:
+ Average wirehair_encoder_create() time: 31 usec (503.226 MBPS)
+ Average wirehair_encode() time: 0 usec (7834.57 MBPS)
+ Average wirehair_decode() time: 2 usec (638.988 MBPS)
+ Average overhead piece count beyond N = 0.011
+ Average wirehair_recover() time: 1 usec (8144.09 MBPS)
For N = 2 packets of 1300 bytes:
+ Average wirehair_encoder_create() time: 11 usec (236.364 MBPS)
+ Average wirehair_encode() time: 0 usec (7435.7 MBPS)
+ Average wirehair_decode() time: 2 usec (476.205 MBPS)
+ Average overhead piece count beyond N = 0.0105
+ Average wirehair_recover() time: 0 usec (9319 MBPS)
For N = 4 packets of 1300 bytes:
+ Average wirehair_encoder_create() time: 8 usec (650 MBPS)
+ Average wirehair_encode() time: 0 usec (8353.43 MBPS)
+ Average wirehair_decode() time: 1 usec (695.102 MBPS)
+ Average overhead piece count beyond N = 0.0225
+ Average wirehair_recover() time: 0 usec (11219 MBPS)
For N = 8 packets of 1300 bytes:
+ Average wirehair_encoder_create() time: 13 usec (800 MBPS)
+ Average wirehair_encode() time: 0 usec (7916.2 MBPS)
+ Average wirehair_decode() time: 1 usec (704.359 MBPS)
+ Average overhead piece count beyond N = 0.0045
+ Average wirehair_recover() time: 1 usec (8973.25 MBPS)
For N = 16 packets of 1300 bytes:
+ Average wirehair_encoder_create() time: 27 usec (770.37 MBPS)
+ Average wirehair_encode() time: 0 usec (7993.4 MBPS)
+ Average wirehair_decode() time: 1 usec (707.211 MBPS)
+ Average overhead piece count beyond N = 0.036
+ Average wirehair_recover() time: 2 usec (9116.81 MBPS)
For N = 32 packets of 1300 bytes:
+ Average wirehair_encoder_create() time: 42 usec (990.476 MBPS)
+ Average wirehair_encode() time: 0 usec (7269.13 MBPS)
+ Average wirehair_decode() time: 1 usec (920.302 MBPS)
+ Average overhead piece count beyond N = 0.0205
+ Average wirehair_recover() time: 5 usec (8061.23 MBPS)
For N = 102 packets of 1300 bytes:
+ Average wirehair_encoder_create() time: 131 usec (1012.21 MBPS)
+ Average wirehair_encode() time: 0 usec (6587.3 MBPS)
+ Average wirehair_decode() time: 1 usec (999.513 MBPS)
+ Average wirehair_encoder_create() time: 41 usec (1014.63 MBPS)
+ Average wirehair_encode() time: 0 usec (7062.93 MBPS)
+ Average wirehair_decode() time: 1 usec (908.097 MBPS)
+ Average overhead piece count beyond N = 0.0195
+ Average wirehair_recover() time: 17 usec (7474 MBPS)
For N = 134 packets of 1300 bytes:
+ Average wirehair_encoder_create() time: 179 usec (973.184 MBPS)
+ Average wirehair_encode() time: 0 usec (5942.63 MBPS)
+ Average wirehair_decode() time: 1 usec (949.373 MBPS)
+ Average overhead piece count beyond N = 0.02
+ Average wirehair_recover() time: 24 usec (7178.03 MBPS)
For N = 169 packets of 1300 bytes:
+ Average wirehair_encoder_create() time: 212 usec (1036.32 MBPS)
+ Average wirehair_encode() time: 0 usec (6016.77 MBPS)
+ Average wirehair_decode() time: 1 usec (975.657 MBPS)
+ Average overhead piece count beyond N = 0.0225
+ Average wirehair_recover() time: 30 usec (7129.99 MBPS)
For N = 201 packets of 1300 bytes:
+ Average wirehair_encoder_create() time: 275 usec (950.182 MBPS)
+ Average wirehair_encode() time: 0 usec (6587.98 MBPS)
+ Average wirehair_decode() time: 1 usec (958.909 MBPS)
+ Average overhead piece count beyond N = 0.012
+ Average wirehair_recover() time: 40 usec (6436.36 MBPS)
For N = 294 packets of 1300 bytes:
+ Average wirehair_encoder_create() time: 355 usec (1076.62 MBPS)
+ Average wirehair_encode() time: 0 usec (6218.16 MBPS)
+ Average wirehair_decode() time: 1 usec (1049.73 MBPS)
+ Average wirehair_recover() time: 5 usec (8057.33 MBPS)
For N = 64 packets of 1300 bytes:
+ Average wirehair_encoder_create() time: 81 usec (1027.16 MBPS)
+ Average wirehair_encode() time: 0 usec (7159.51 MBPS)
+ Average wirehair_decode() time: 1 usec (1033.95 MBPS)
+ Average overhead piece count beyond N = 0.017
+ Average wirehair_recover() time: 10 usec (7640.74 MBPS)
For N = 128 packets of 1300 bytes:
+ Average wirehair_encoder_create() time: 192 usec (866.667 MBPS)
+ Average wirehair_encode() time: 0 usec (5662.07 MBPS)
+ Average wirehair_decode() time: 1 usec (870.14 MBPS)
+ Average overhead piece count beyond N = 0.015
+ Average wirehair_recover() time: 25 usec (6419.38 MBPS)
For N = 256 packets of 1300 bytes:
+ Average wirehair_encoder_create() time: 319 usec (1043.26 MBPS)
+ Average wirehair_encode() time: 0 usec (6333.2 MBPS)
+ Average wirehair_decode() time: 1 usec (1018.77 MBPS)
+ Average overhead piece count beyond N = 0.022
+ Average wirehair_recover() time: 50 usec (6602.26 MBPS)
For N = 512 packets of 1300 bytes:
+ Average wirehair_encoder_create() time: 670 usec (993.433 MBPS)
+ Average wirehair_encode() time: 0 usec (6483.91 MBPS)
+ Average wirehair_decode() time: 1 usec (1028.85 MBPS)
+ Average overhead piece count beyond N = 0.022
+ Average wirehair_recover() time: 100 usec (6600.1 MBPS)
For N = 1024 packets of 1300 bytes:
+ Average wirehair_encoder_create() time: 1697 usec (784.443 MBPS)
+ Average wirehair_encode() time: 0 usec (5309.05 MBPS)
+ Average wirehair_decode() time: 1 usec (671.005 MBPS)
+ Average overhead piece count beyond N = 0.022
+ Average wirehair_recover() time: 207 usec (6404.05 MBPS)
For N = 2048 packets of 1300 bytes:
+ Average wirehair_encoder_create() time: 3227 usec (825.039 MBPS)
+ Average wirehair_encode() time: 0 usec (5202.3 MBPS)
+ Average wirehair_decode() time: 1 usec (683.141 MBPS)
+ Average overhead piece count beyond N = 0.021
+ Average wirehair_recover() time: 55 usec (6894.69 MBPS)
For N = 359 packets of 1300 bytes:
+ Average wirehair_encoder_create() time: 457 usec (1021.23 MBPS)
+ Average wirehair_encode() time: 0 usec (7052.25 MBPS)
+ Average wirehair_decode() time: 1 usec (1082.96 MBPS)
+ Average overhead piece count beyond N = 0.0165
+ Average wirehair_recover() time: 66 usec (7004.4 MBPS)
For N = 413 packets of 1300 bytes:
+ Average wirehair_encoder_create() time: 524 usec (1024.62 MBPS)
+ Average wirehair_encode() time: 0 usec (6426.07 MBPS)
+ Average wirehair_decode() time: 1 usec (1079.96 MBPS)
+ Average overhead piece count beyond N = 0.021
+ Average wirehair_recover() time: 76 usec (7044.54 MBPS)
For N = 770 packets of 1300 bytes:
+ Average wirehair_encoder_create() time: 1201 usec (833.472 MBPS)
+ Average wirehair_encode() time: 0 usec (7265.59 MBPS)
+ Average wirehair_decode() time: 1 usec (865.626 MBPS)
+ Average overhead piece count beyond N = 0.018
+ Average wirehair_recover() time: 144 usec (6927.41 MBPS)
For N = 1000 packets of 1300 bytes:
+ Average wirehair_encoder_create() time: 1564 usec (831.202 MBPS)
+ Average wirehair_encode() time: 0 usec (5314.48 MBPS)
+ Average wirehair_decode() time: 1 usec (696.552 MBPS)
+ Average overhead piece count beyond N = 0.019
+ Average wirehair_recover() time: 195 usec (6653.45 MBPS)
+ Average wirehair_recover() time: 441 usec (6026.08 MBPS)
For N = 4096 packets of 1300 bytes:
+ Average wirehair_encoder_create() time: 7614 usec (699.343 MBPS)
+ Average wirehair_encode() time: 0 usec (4334.08 MBPS)
+ Average wirehair_decode() time: 2 usec (577.674 MBPS)
+ Average overhead piece count beyond N = 0.0215
+ Average wirehair_recover() time: 1208 usec (4405.65 MBPS)
For N = 8192 packets of 1300 bytes:
+ Average wirehair_encoder_create() time: 17208 usec (618.875 MBPS)
+ Average wirehair_encode() time: 0 usec (3277.17 MBPS)
+ Average wirehair_decode() time: 2 usec (521.665 MBPS)
+ Average overhead piece count beyond N = 0.075
+ Average wirehair_recover() time: 2916 usec (3651.35 MBPS)
For N = 16384 packets of 1300 bytes:
+ Average wirehair_encoder_create() time: 42512 usec (501.016 MBPS)
+ Average wirehair_encode() time: 0 usec (2646.89 MBPS)
+ Average wirehair_decode() time: 2 usec (435.173 MBPS)
+ Average overhead piece count beyond N = 0.015
+ Average wirehair_recover() time: 7282 usec (2924.63 MBPS)
For N = 32768 packets of 1300 bytes:
+ Average wirehair_encoder_create() time: 111287 usec (382.78 MBPS)
+ Average wirehair_encode() time: 0 usec (2378.29 MBPS)
+ Average wirehair_decode() time: 3 usec (342.556 MBPS)
+ Average overhead piece count beyond N = 0.0195
+ Average wirehair_recover() time: 16326 usec (2609.23 MBPS)
~~~


Expand Down
4 changes: 2 additions & 2 deletions WirehairTools.cpp
Expand Up @@ -684,7 +684,7 @@ const uint8_t kSmallDenseSeeds[kSmallTableCount] = {
};

const uint8_t kSmallPeelSeeds[kTinyTableCount + kSmallTableCount] = {
0,0,0,0,1,0,0,0,1,0,0,0,5,1,0,0,4,3,0,0,0,3,0,1,7,2,3,12,11,9,2,3,
0,0,0,11,1,0,0,0,1,0,0,0,5,1,0,0,4,11,0,0,0,3,0,1,7,2,3,12,11,9,2,3,
0,3,1,9,21,46,5,8,27,4,37,37,69,5,180,8,30,201,21,23,12,59,151,77,214,216,221,46,23,89,39,11,
46,228,189,11,18,24,41,229,31,123,11,39,119,19,10,102,178,23,131,210,2,116,219,34,43,105,22,128,87,187,179,89,
70,54,65,173,190,85,98,98,238,16,57,80,67,115,135,178,80,195,135,183,113,116,199,137,4,152,33,146,185,46,153,141,
Expand Down Expand Up @@ -972,7 +972,7 @@ uint16_t GetDenseSeed(unsigned N, unsigned dense_count)
// PeelSeed

const uint8_t kPeelSeeds[kPeelSeedSubdivisions] = {
11,13,4,7,6,13,1,6,13,7,15,13,11,1,6,7,13,5,12,11,7,14,2,10,13,3,3,3,1,9,13,7,
0,13,4,7,6,13,1,6,13,7,15,13,11,1,6,7,13,5,12,11,7,14,2,10,13,3,3,3,1,9,13,7,
2,9,10,0,2,14,14,0,13,11,5,0,15,14,7,3,15,2,1,3,7,2,15,12,9,10,14,12,5,13,1,7,
2,4,3,15,17,11,9,10,11,4,7,15,0,14,1,2,10,7,11,3,14,1,3,14,0,1,7,2,3,2,17,10,
3,12,0,6,4,5,9,15,11,9,18,11,8,3,6,4,5,27,9,13,5,13,5,12,4,13,2,7,16,0,4,5,
Expand Down
4 changes: 1 addition & 3 deletions tables/GenerateSmallDenseSeeds.cpp
Expand Up @@ -19,9 +19,7 @@ static const int kTrials = 3500;
// the ones that tend to fail too much can be put in this list and
// refined further.
static const int N_List[] = {
781,
1000,
1386
17,
};
// This only works up to 2047. After that the GenerateMostDenseSeeds
// and GeneratePeelSeeds programs take over.
Expand Down
5 changes: 2 additions & 3 deletions test/UnitTest.cpp
Expand Up @@ -10,6 +10,7 @@ using namespace std;
#define ENABLE_OMP
#define ENABLE_PARTIAL_FINAL
#define ENABLE_ALL_RECOVERY_FINAL_BLOCK
#define BENCHMARK_SHORT_LIST

static const unsigned kMinN = 2;
static const unsigned kMaxN = 64000;
Expand Down Expand Up @@ -701,7 +702,7 @@ static bool ReadmeExample()
static bool Benchmark(unsigned N, unsigned packetBytes, unsigned trials)
{
siamese::PCGRandom prng;
prng.Seed(N, 0);
prng.Seed(N, packetBytes);

const unsigned kBlockBytes = packetBytes;
const unsigned kMessageBytes = N * kBlockBytes;
Expand Down Expand Up @@ -875,8 +876,6 @@ static const unsigned kBenchmarkNList[] = {
1000
};

#define BENCHMARK_SHORT_LIST

int main()
{
const WirehairResult initResult = wirehair_init();
Expand Down

0 comments on commit 89c02d7

Please sign in to comment.