matthew-a-thomas / js-ldpc

A JavaScript implementation of a Low-Density Parity-Check code
MIT License
3 stars 2 forks source link

Slow for larger n #7

Open matthew-a-thomas opened 8 years ago

matthew-a-thomas commented 8 years ago

Larger values of n take a long time to decode. Seems to be much more than O(n).

For example, this snippet of code takes ~10 times as long as the snippet below:

var start = Date.now();
var options = {
  n: 512,
  k: 256,
  modulo: 2
};
var ldpc = new LDPC(options);
ldpc.decode(Array(options.k));
console.log("done after " + (Date.now() - start) + "ms");

This snippet takes about 1/10 as long as the above snippet:

var start = Date.now();
var options = {
  n: 256,
  k: 128,
  modulo: 2
};
var ldpc = new LDPC(options);
ldpc.decode(Array(options.k));
console.log("done after " + (Date.now() - start) + "ms");
matthew-a-thomas commented 8 years ago

Note I'm noticing this in version https://github.com/matthew-a-thomas/js-ldpc/releases/tag/v0.0.2