emscripten-core / emscripten-core/emscripten

Dlib + opencv webworker performance

Open
#14,327 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

Hi guys,

I hope somebody can suggest some solutions or the root of the issue.
I found this repo https://github.com/seanchas116/wasm-face-detection.
Basically dlib/opencv emscripten build.
I took it, removed all logic with canvas rendering and use only Face Tracking part, and it works fine.
The issue I'm facing with is if I run the build in a dedicated worker.
Performance drastically decreases. If I run it in the main thread I get ~60ms for face Track. If the same code is moved to a web worker performance drops down to ~180 -200ms per cycle (I measure only tracking function, all message potsings, data convertioans etc. are not included in execution time measurement).
How can I overcome the issue? I tried to change optimization options (-O3 by default), but got only execution time increasing.
Are there any specifics how wasms run in workers?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.