got icon indicating copy to clipboard operation
got copied to clipboard

Snappy integration

Open xamgore opened this issue 4 years ago • 3 comments

What problem are you trying to solve?

Speed up the decompression stage for Buffers.

Describe the feature

https://github.com/Brooooooklyn/snappy

Running "Decompress" suite...
Progress: 25%

  snappy:
    2 771 ops/s, ±1.13%

  gzip:
    854 ops/s, ±6.99%

  deflate:
    877 ops/s, ±3.19%

  brotli:
    638 ops/s, ±2.31%     | slowest, 76.98% slower

As I may see, decompress-response operates on streams, though, got.js may exploit snappy when the end-user has decided to receive Buffer instead of working directly with streams.

xamgore avatar Sep 14 '21 20:09 xamgore

This is a non standard feature. It would be best if this was a Got plugin instead.

szmarczak avatar Sep 14 '21 22:09 szmarczak

Do you mean a plugin defining afterResponse hook?

xamgore avatar Sep 15 '21 09:09 xamgore

Hm... I haven't thought how to do it properly. Maybe there should be an option to transform the data 🤔

szmarczak avatar Sep 15 '21 09:09 szmarczak