Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

fix: replace slice with subarray for increased performance #4210

Merged
merged 6 commits into from Sep 23, 2022

Commits on Sep 16, 2022

  1. fix: replace slice with subarray for increased performance

    In several places we call `.slice` as a way to transform `BufferList`s
    to `Uint8Array`s. Due to refactors in some places we are now calling
    `.slice` on `Uint8Array`s which is a memory-copy operation.
    
    In other places `Uint8ArrayList`s are now returned instead of `BufferList`s
    on which `.slice` is also a memory-copy operation.
    
    Swap `.slice` for `.subarray` which is no-copy for `Uint8Array`s and
    can be no-copy for `Uint8ArrayList`s too, where there is only a single
    backing buffer.
    
    In places where we need to transform multiple `Uint8ArrayList`s to
    multiple `Uint8Array`s, yield the iterators of the `Uint8ArrayList`s
    as this is also a no-copy operation.
    achingbrain committed Sep 16, 2022
    Copy the full SHA
    b5aaf41 View commit details
    Browse the repository at this point in the history
  2. chore: linting

    achingbrain committed Sep 16, 2022
    Copy the full SHA
    090127b View commit details
    Browse the repository at this point in the history

Commits on Sep 23, 2022

  1. Copy the full SHA
    7393656 View commit details
    Browse the repository at this point in the history
  2. chore: fix test

    achingbrain committed Sep 23, 2022
    Copy the full SHA
    dcfecce View commit details
    Browse the repository at this point in the history
  3. chore: fix browser tests

    achingbrain committed Sep 23, 2022
    Copy the full SHA
    d628322 View commit details
    Browse the repository at this point in the history
  4. Copy the full SHA
    73deff8 View commit details
    Browse the repository at this point in the history