vue-qrcode-reader
vue-qrcode-reader copied to clipboard
use paused introduce around 1s to 2s of freeze
Describe the bug I need to scan multiples times the same QRcode with low latency (< 250ms) the usecase is for point of sales with multiples times the same barcode
To Reproduce https://stackblitz.com/edit/vue3-script-setup-with-vite-h2dnn7?file=src%2FApp.vue
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: windows & Macos
- Browser chrome and safari
I tryed to take a look at source code to make a PR but I have no idea where the issue is
Thanks for the demo. Note that scanning is slower the more barcode formats you select. If I select only qr_code or only ean_13 in your demo, I get significantly less delay. You can log the detected codes in paintOutline to see the true scanning frequency:
function paintOutline(detectedCodes, ctx) {
console.debug(detectedCodes)
That logs detected codes at maximum rate no matter what you do with the paused prop. But note that it's not recommended to update state in this function, since it's called so frequently at might cause memory leaks.
That logs detected codes at maximum rate no matter what you do with the
pausedprop. But note that it's not recommended to update state in this function, since it's called so frequently at might cause memory leaks.
thanks for the quick response, I didn't think about paintOutline 😅
I suppose with a throttle the risk of memory leaks should be attenuated no ?
I suppose with a throttle the risk of memory leaks should be attenuated no ?
You can try. At your own risk though 😜
On my end, reducing the number of formats seemed sufficient to improve latency. Can you confirm?
This issue has been marked as stale. If there is no further activity it will be closed.