8000 GitHub - faizrktm/barcode-reader-wasm: Performance comparison between jsqr and quirc (with wasm) that runs on web worker. For educational purposes.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

faizrktm/barcode-reader-wasm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QR Reader / Scanner jsQR and quirc (C with WASM) through Web Worker

This project is experimental and for educational purpose to see performance of WASM and JS for decode QR Code. Using:

  1. quirc library from C language with Web Assembly
  2. jsQR library using pure javascript
  3. Svelte for UI Framework
  4. Rollup for bundler
  5. Decoder run through Web Worker, it is off main thread!

⚠️ Please read

If you see error when using quirc scanner on safari / wasm not properly loaded. It is due to the rollup wasm loader only use WebAssembly.instantiateStreaming() without fallback and not supported on safari. So please use Chrome or other browser instead. ✌️

Instalation

install dependencies and devDependencies

$ yarn install

build and start server for development in watch mode

$ yarn dev

Open http://localhost:1001 to see the website

build for production

$ yarn build

build for production and start server

$ yarn build:start

Updating barcode.c code

You need to install emscripten to be able to compile the C code to .wasm format. Learn HERE.

After successfully install emscipten, run this script to compile the C code to wasm.

No optimization

$ yarn build:wasm

Full optimization

$ yarn build:wasm:prod

For optimization explanation, read https://emscripten.org/docs/optimizing/Optimizing-Code.html#how-to-optimize-code

About

Performance comparison between jsqr and quirc (with wasm) that runs on web worker. For educational purposes.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0