Git Product home page Git Product logo

wasm-lz4's People

Contributors

davidcrawford avatar jhurliman avatar troygibb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wasm-lz4's Issues

Benchmarks

For those interested, here are a few anecdotal benchmarks which suggest a slight improvement in using wasm-lz4 over lz4

bag lz4 wasm
129MB bag 14.16s 13.86s
129MB bag 14.72s 13.932s
129MB bag 14.14s 13.583s
801MB bag 1m31s 1m26s
801MB bag 1m28s 1m28s
801MB bag 1m28s 1m26s

lz4

    decompress: { lz4: buffer => Buffer.from(lz4.decompress(buffer)) },

wasm-lz4

    decompress: { lz4: decompress },

Hopefully, I'm not doing anything incorrectly to skew the numbers.
๐Ÿ‘

Error when loading wasm-lz4 in Node 18

Steps to reproduce:

$ docker run -it --rm node:18 /bin/bash
# mkdir test && cd test
# npm init -y && npm i wasm-lz4
# node -e 'require("wasm-lz4")'

Result:

(node:31) ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
node:internal/deps/undici/undici:11118
    Error.captureStackTrace(err, this);
          ^

TypeError: Failed to parse URL from /test/node_modules/wasm-lz4/wasm-lz4.wasm
    at Object.fetch (node:internal/deps/undici/undici:11118:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  [cause]: TypeError [ERR_INVALID_URL]: Invalid URL
      at new NodeError (node:internal/errors:393:5)
      at URL.onParseError (node:internal/url:565:9)
      at new URL (node:internal/url:645:5)
      at new Request (node:internal/deps/undici/undici:9472:25)
      at Agent.fetch2 (node:internal/deps/undici/undici:10291:25)
      at Object.fetch (node:internal/deps/undici/undici:11116:28)
      at fetch (node:internal/process/pre_execution:216:25)
      at instantiateAsync (/test/node_modules/wasm-lz4/wasm-lz4.js:9:8977)
      at createWasm (/test/node_modules/wasm-lz4/wasm-lz4.js:9:9587)
      at /test/node_modules/wasm-lz4/wasm-lz4.js:9:10837 {
    input: '/test/node_modules/wasm-lz4/wasm-lz4.wasm',
    code: 'ERR_INVALID_URL'
  }
}

Node.js v18.12.1

The same error does not occur when using Node 16.

This appears to be caused by emscripten-core/emscripten#16915, which was fixed in emscripten-core/emscripten#16917 (available in emscripten 3.1.13 and later), so it could likely be fixed by upgrading emscripten.

See also: foxglove/wasm-bz2#4

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.