How can I optimize the scan performance of the Web SDK?

The performance of the scanner depends in part on the device and camera used.  For optimal speed/quality in different situations please keep in mind the following guidelines/tips:

  - Enable only the symbologies you need: 1D code scanning is usually faster than 2D code scanning; only having 1D codes enabled is fastest.

  - Only increase the maximum amount of codes per single frame from the default of 1 if it's really needed.

  - If possible, restrict the scanning search area to be less than the default full frame.

  - Depending on your use case, it might be worth to enable Full HD video quality, resulting in slower frame processing times but better recognition.  (Check out the HD mode in the demo)

In order to provide the best possible experience in your web application, please follow these guidelines to guarantee optimal performance of the library:

  - Ensure the JavaScript assets and the `scandit-engine-sdk.min.js` and `scandit-engine-sdk.wasm` files are served compressed and with caching enabled by your web server.

  - Re-use `BarcodePicker` objects whenever possible by hiding and showing them instead of destroying and recreating them: each object needs to load and initialize the external library on creation.

  - If possible, create a (hidden and paused) `BarcodePicker` in the background and simply resume scanning switch its visibility to "show" when needed instead of creating it on the fly to provide instant scanning capabilities.

  - Remember to use `destroy()` methods on the `Scanner` or `BarcodePicker` objects when they are not needed anymore, before they are automatically garbage collected by JavaScript. This will ensure all needed resources are correctly cleaned up.

  - Camera permissions can be asked to the user in advance via this library or other external methods.

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request