summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDaniel Axtens <dja@axtens.net>2017-02-10 13:55:15 +1100
committerDaniel Axtens <dja@axtens.net>2017-02-13 09:43:24 +1100
commit90679884efa7bc277ced354032ca655e1e99faa2 (patch)
treeffdc8f21cbafe74e551d93b3633e4fc7102c12c4 /include
parent10e096fe097a489eec41bad120f5b5e52fa4b61c (diff)
downloadliberasurecode-90679884efa7bc277ced354032ca655e1e99faa2.tar.gz
ISA-L: Only calculate gf tables on init, not every encode
Currently, the Galois Field multiplication tables are recalcuated every time an encode is done. This is wasteful, as they are fixed by k and m, which is set on init. Calculate the tables only once, on init. This trades off a little bit of per-context memory and creation time for measurably faster encodes when using the same context. On powerpc64le, when repeatedly encoding a 4kB file with pyeclib, this increases the measured speed by over 10%. Change-Id: I2f025aaee2d13cb1717a331e443e179ad5a13302 Signed-off-by: Daniel Axtens <dja@axtens.net>
Diffstat (limited to 'include')
-rw-r--r--include/isa_l/isa_l_common.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/isa_l/isa_l_common.h b/include/isa_l/isa_l_common.h
index caad19a..0445544 100644
--- a/include/isa_l/isa_l_common.h
+++ b/include/isa_l/isa_l_common.h
@@ -52,6 +52,7 @@ typedef struct {
/* fields needed to hold state */
unsigned char *matrix;
+ unsigned char *encode_tables;
int k;
int m;
int w;