ssz icon indicating copy to clipboard operation
ssz copied to clipboard

Replace iterables throughout

Open wemeetagain opened this issue 3 years ago • 0 comments

Using the iterable interface instead of Arrays is much slower, even a for of of an array is slower than a simple for(;;) iterating over an array. Since ssz is a low level library, meant to be used in higher-performance applications (such as Lodestar), we need to squeeze as much performance as possible.

There's still some iterator nonsense in ssz that should be removed:

  • use of iterateAtDepth, not to be confused with Tree#iterateNodesAtDepth which is resolved with #167, needs a getGindicesAtDepth alternative
  • use of generator functions in public interface, needs an array alternative, can be introduced in a non-breaking change

wemeetagain avatar Aug 23 '21 16:08 wemeetagain