You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// engineResourcePaths typically is only assigned when using a framework like React/Angular/Vue where the resources are not in the same location as the script reference.
description: How to enable -SIMD-Pthread Wasm for accelerated deep learning computation?
6
+
needAutoGenerateSidebar: false
7
+
---
8
+
9
+
# About Adaptive WebAssembly (Wasm) Loading
10
+
11
+
## What is adaptive Wasm loading?
12
+
13
+
Dynamsoft Barcode Reader(JavaScript) includes **three optimized WebAssembly (Wasm) variants** — *-Baseline*, *-Pthread*, and *-SIMD-Pthread* — which can be **dynamically loaded based on the runtime environment**.
14
+
This adaptive loading mechanism ensures the SDK automatically selects the **most compatible and highest-performing** Wasm module available in each browser, further improving performance in modern environments.
|**Parallelism**| Single-threaded | Single Instruction Multiple Data (CPU vector instruction set) | Multi-threaded(via Web Workers + SharedArrayBuffer) + SIMD |
23
+
|**Performance Characteristics**| Simple, limited by single-core performance | Leverages CPU vectorized parallelism to speed up data processing | Combines SIMD vectorization and multi-core acceleration for maximum performance |
24
+
|**Compatibility**| Supported in all Wasm environments | Requires browser support for Wasm SIMD instruction set | Requires browser support for both Wasm SIMD and Wasm threads (cross-origin isolation) |
## How to enable -SIMD-Pthread Wasm for accelerated deep learning computation?
31
+
32
+
To unlock multi-threaded performance with the **-SIMD-Pthread Wasm** variant, configure your server to enable **cross-origin isolation** by adding the following HTTP headers to all responses:
33
+
34
+
```text
35
+
Cross-Origin-Opener-Policy: same-origin
36
+
Cross-Origin-Embedder-Policy: require-corp
37
+
```
38
+
39
+
Then, ensure that all SDK resources are **served under the same origin**.
40
+
41
+
Once correctly configured, the SDK will automatically detect the environment and load the `-SIMD-Pthread Wasm` to leverage multi-core acceleration.
42
+
43
+
>[!TIP]
44
+
>You can verify whether your site is correctly isolated by checking the browser console for cross-origin isolation status or by calling window.crossOriginIsolated in DevTools.
45
+
46
+
## How to manually specify which Wasm variant to load?
47
+
48
+
By default, the SDK automatically determines the most suitable WebAssembly (Wasm) variant to load based on the browser’s capabilities.
49
+
However, developers can **manually override** this behavior and explicitly specify which Wasm module to load through the `wasmLoadOptions` property.
|"auto"; // Automatically select based on environment
68
+
```
69
+
70
+
>[!NOTE]
71
+
>Setting wasmType to "auto" (default) allows the SDK to automatically choose the optimal Wasm based on runtime capability detection.
72
+
>
73
+
>When using "ml-simd-pthread", ensure that cross-origin isolation is properly configured as described in How to enable `-SIMD-Pthread Wasm` for accelerated deep learning computation.
74
+
>
75
+
>If the specified Wasm variant is not supported in the current browser, the SDK will gracefully fall back to a compatible variant.
76
+
77
+
## Why isn’t -SIMD-Pthread Wasm enabled by default on iOS?
78
+
79
+
Due to iOS’s strict memory allocation and management limitations, loading `-SIMD-Pthread Wasm` can sometimes lead to “out of memory” errors on older devices or iOS versions.
80
+
To ensure stability and compatibility, the SDK does not load `-SIMD-Pthread Wasm` by default on iOS. Instead, it automatically falls back to the most suitable Baseline or SIMD variant depending on the environment.
Copy file name to clipboardExpand all lines: programming/javascript/index.md
+17-17Lines changed: 17 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,25 +13,25 @@ breadcrumbText: JavaScript
13
13
14
14
Dynamsoft Barcode Reader (DBR) can be used in JavaScript to add barcode reading capabilities to websites running in modern browsers. It is ideal for
15
15
16
-
* organizations who already have sophisticated websites and do not intend to develop mobile applications for the same purposes; or
17
-
* organizations whose customers have no desire to install applications for temporary usage of their services.
16
+
- organizations who already have sophisticated websites and do not intend to develop mobile applications for the same purposes; or
17
+
- organizations whose customers have no desire to install applications for temporary usage of their services.
18
18
19
19
To get a fast start, you can
20
20
21
-
* read the [User Guide](user-guide/barcode-scanner.html), or
22
-
* try the [Samples and Demos](samples-demos/)
21
+
- read the [User Guide](user-guide/barcode-scanner.html), or
22
+
- try the [Samples and Demos](samples-demos/)
23
23
24
24
The following describes the highlights of DBR JavaScript edition (DBR-JS) version 11.x.
25
25
26
26
# ✨BarcodeScanner – Simplified API and Built-in UI
27
27
28
-
The `BarcodeScanner` class offering a streamlined API and a prebuilt interactive UI, making barcode scanning integration easier than ever. This is now the recommended way to use DBR-JS, especially for developers who want a quick, clean, and robust scanning experience with minimal setup.
28
+
The `BarcodeScanner` class offers a streamlined API and a prebuilt interactive UI, making barcode scanning integration easier than ever. This is now the recommended way to use DBR-JS, especially for developers who want a quick, clean, and robust scanning experience with minimal setup.
29
29
30
30
With `BarcodeScanner`, you can:
31
31
32
-
- Instantiate and configure the scanner with just a few lines of code;
32
+
- Instantiate and configure the scanner with just a few lines of code.
33
33
34
-
- Select your scanning mode and present a ready-to-use scanning interface;
34
+
- Select your scanning mode and present a ready-to-use scanning interface.
35
35
36
36
- Focus on your application logic without worrying about camera setup, UI rendering, or lifecycle management.
37
37
@@ -42,11 +42,11 @@ With `BarcodeScanner`, you can:
42
42
43
43
## Fast Integration
44
44
45
-
This [JSFiddle example](https://jsfiddle.net/DynamsoftTeam/gcqjf5r7/) demonstrates all the code needed to build a web application using `BarcodeScanner`, end users of the web page can open it in a browser, access their cameras and read barcodes directly from the video input.
45
+
This [JSFiddle example](https://jsfiddle.net/DynamsoftTeam/gcqjf5r7/) demonstrates all the code needed to build a web application using `BarcodeScanner`. End users of the web page can open it in a browser, access their cameras, and read barcodes directly from the video input.
46
46
47
47
### Camera Control
48
48
49
-
Customers generally need to scan a barcode on the fly at which time there is no better input than the camera hooked to or built into the device itself. As shown in the code snippet above, the product **Dynamsoft Camera Enhancer (DCE)** is used to provide camera support. It makes use of the powerful [**MediaDevices**](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices) interface (provided by the browser itself) to instantly access the video input of the camera, capture image frames and supply them to the back-end decoding engine.
49
+
Customers generally need to scan a barcode on the fly at which time there is no better input than the camera hooked to or built into the device itself. As shown in the example above, the product **Dynamsoft Camera Enhancer (DCE)** is used to provide camera support. It makes use of the powerful [**MediaDevices**](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices) interface (provided by the browser itself) to instantly access the video input of the camera, capture image frames and supply them to the back-end decoding engine.
50
50
51
51
> DBR and DCE communicate through the interface called [Image Source Adapter]({{ site.dcvb_architecture }}input.html#image-source-adapter?lang=js).
52
52
@@ -74,21 +74,21 @@ The actual use environment is unpredictable. The barcode may appear distorted, i
74
74
75
75
DBR does a lot of preparation work to make sure the barcode is as legible as possible for the decoding engine to read. This ensures a very high accuracy. In addition, DBR achieves even higher accuracy through the following ways:
76
76
77
-
* DBR can verify results by comparing the results of multiple consecutive recognitions;
78
-
* DBR has a confidence score for each recognition which can be used to filter unwanted results;
79
-
* DBR is also able to verify the barcode result with printed text that accompanies the barcode with the help of the product **Dynamsoft Label Recognizer (DLR)**.
77
+
- DBR can verify results by comparing the results of multiple consecutive recognitions;
78
+
- DBR has a confidence score for each recognition which can be used to filter unwanted results;
79
+
- DBR is also able to verify the barcode result with printed text that accompanies the barcode with the help of the product **Dynamsoft Label Recognizer (DLR)**.
80
80
81
-
Through many experiences, DBR has also cultivated its error correction ability to handle
81
+
Through extensive real-world use, DBR has also cultivated its error correction ability to handle:
82
82
83
-
* Non-standard barcodes which do not strictly abide by the specification;
84
-
* Deformed barcodes which are usually caused by improper printing.
83
+
- Non-standard barcodes which do not strictly abide by the specification;
84
+
- Deformed barcodes which are usually caused by improper printing.
85
85
86
86
## Effortless Expansion
87
87
88
88
DBR-JS v11.x is based on [Dynamsoft Capture Vision]({{site.dcvb_architecture}}) which is a modular architecture. This architecture makes it easy to add new functionality or custom behavior with very little change to the code. Two examples are:
89
89
90
-
* Add **Dynamsoft Document Normalizer (DDN)** to do perspective correction before pass an image frame to read barcodes;
91
-
* Add **Dynamsoft Code Parser (DCP)** to parse the text embedded in the PDF417 on driver's licenses.
90
+
- Add **Dynamsoft Document Normalizer (DDN)** to do perspective correction before passing an image frame to read barcodes;
91
+
- Add **Dynamsoft Code Parser (DCP)** to parse the text embedded in the PDF417 on driver's licenses.
Copy file name to clipboardExpand all lines: programming/javascript/release-notes/js-11.md
+63Lines changed: 63 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,69 @@ noTitleIndex: true
10
10
11
11
# Release Notes for Dynamsoft Barcode Reader JavaScript SDK
12
12
13
+
## 11.2.2000 (10/30/2025)
14
+
15
+
### ✨ Key Highlights
16
+
#### AI-Powered Barcode Detection and Decoding
17
+
18
+
- New Localization Models – Introduces [`OneDLocalization`]({{ site.dcvb_parameters }}barcode-reader-task-settings/localization-modes.html#modelnamearray) and [`DataMatrixQRCodeLocalization`]({{ site.dcvb_parameters }}barcode-reader-task-settings/localization-modes.html#modelnamearray) neural network models for improved detection of **blurred / low-resolution 1D codes**, or **partially damaged DataMatrix/QR codes**.
19
+
- Specialized Decoders – Adds [`EAN13Decoder`]({{ site.dcvb_parameters }}barcode-reader-task-settings/deblur-modes.html#modelnamearray) and [`Code128Decoder`]({{ site.dcvb_parameters }}barcode-reader-task-settings/deblur-modes.html#modelnamearray) models optimized for **long-distance** and **motion-blurred** decoding scenarios.
20
+
- Redesigned Deblur Model – The [`OneDDeblur`]({{ site.dcvb_parameters }}barcode-reader-task-settings/deblur-modes.html#modelnamearray) model now provides more effective recovery from **motion and focus blur**.
21
+
- Configurable Model Selection – The new `ModelNameArray` parameter supports flexible model loading and fine-grained control for specific barcode types.
22
+
23
+
#### Precision and Processing Control
24
+
25
+
- Enhanced Deblur Methods – [`DM_DEEP_ANALYSIS`]({{ site.dcvb_parameters }}barcode-reader-task-settings/deblur-modes.html#dm_deep_analysis) now includes sub-level control with `OneDGeneral`, `TwoDGeneral`, and `EAN13Enhanced` options.
26
+
- Barcode Count Expectation – The new [`ExpectedBarcodesCount`]({{ site.dcvb_parameters }}barcode-format-specification/expected-barcodes-count.html) parameter enables **format-specific quantity control** and **early termination** in fixed-count workflows.
27
+
- Improved Region Detection – The new [`RPM_GRAY_CONSISTENCY`]({{ site.dcvb_parameters }}image-parameter/region-predetection-modes.html#rpm_gray_consistency) mode provides more precise region extraction based on **grayscale uniformity** and **local consistency** for document and label processing.
28
+
29
+
### Performance Highlights
30
+
31
+
- Up to **26.5%** higher read rates under blur conditions with as much as **44%** faster processing.
32
+
- Reliable decoding of DataMatrix and QR codes with missing or damaged finder patterns.
33
+
- Extended operational range beyond 75 cm for long-distance barcode scanning.
34
+
35
+
### Developer Notes
36
+
37
+
- Backward Compatibility – Fully compatible with existing integrations; no code-level changes required for upgrade.
38
+
- Configuration Flexibility – Expanded parameter set allows comprehensive model configuration for scenario-specific tuning.
39
+
- Production Stability – All new models validated in enterprise environments.
40
+
41
+
#### Updates for [BarcodeScanner](https://dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/barcode-scanner.html)
42
+
43
+
- In **single** mode, if the target barcode is not found among the candidates, there is now an opportunity to rescan.
- Fixed an issue where the barcode location could be inaccurate in certain cases.
46
+
- Fixed a problem where, in specific cases when the camera was occupied, the video stream could not be displayed correctly.
47
+
- Other known issues fixed.
48
+
49
+
#### Engineering Optimizations
50
+
51
+
- Optimized the parallel download logic to improve resource loading speed.
52
+
- Optimized [adaptive WASM loading logic](../faq/adaptive-wasm-loading.md) to further enhance performance in modern browser environments.
53
+
54
+
### API Changes
55
+
56
+
#### New
57
+
58
+
- Added the `switchCapturingTemplate()` method to the `CaptureVisionRouter` class to enable switching the active capturing template during the image processing workflow.
59
+
- Added methods `toBlob()`, `toImage()`, and `toCanvas()` to the `originalImageResultItem` interface for flexible image data conversion.
60
+
- Added the `SetGlobalIntraOpNumThreads()` method to the `CaptureVisionRouter` class to configure the global thread count for model inference.
61
+
- Added the `clearDLModelBuffers()` method to the `CaptureVisionRouter` class to manually release memory occupied by loaded models.
62
+
- Added callback functions `onSpecLoadProgressChanged()` and `onWasmLoadProgressChanged()` to monitor resource loading progress.
63
+
- Added the `convertToContainCoordinates()` method to the `CameraEnhancer` class to convert coordinates from `fit: cover` to `fit: contain` mode.
64
+
- Added the `LM_NEURAL_NETWORK` enumeration to `EnumLocalizationMode`.
65
+
66
+
#### Updated
67
+
68
+
- Changed the default value of `MaxThreadsInOneTask` from **4** to **0**.
69
+
- Changed the default value of `IncludeTrailingCheckDigit` from **1** to **0**.
70
+
71
+
#### Deprecated
72
+
73
+
- Deprecated the `DeblurModelNameArray` argument in the `DeblurModes` parameter. Use `ModelNameArray` instead.
74
+
- Deprecated the `appendModelBuffer()` method in the `CaptureVisionRouter` class. Use `appendDLModelBuffer()` instead.
0 commit comments