bowser icon indicating copy to clipboard operation
bowser copied to clipboard

Performance bottleneck in image copying

Open ijsf opened this issue 9 years ago • 6 comments

I've been testing OpenWebRTC in combination with Bowser on an iPad Mini Gen 1 (armv7), and noticed that image buffer copying/moving takes up a significant portion of time on this particular device.

When profiling with Time Analyzer, a _platform_memmove call that originates from WebCore seems to take up at least 12% of CPU when displaying local video on demo.openwebrtc.io:38080 (not calling), and this only gets worse once a call is initiated.

I'm not quite sure why this bottleneck is appearing for local video, as the video screen is very small in comparison to the window size. Can anybody shine some light on this?

ijsf avatar Mar 11 '15 11:03 ijsf

The current rendering in Bowser is a hack, really. The video element gets replaced by a repeatedly updated image element. This is highly inefficient as bitmap (I think) images are transferred over localhost.

The proper way to do this is by replacing the hack with OpenGL rendering, the same way native OpenWebRTC apps render video. We have a solution that is 90% complete.

stefanalund avatar Mar 11 '15 20:03 stefanalund

Great. Would be nice to test this so I can start evaluating and improving OpenWebRTC performance on armv7.

ijsf avatar Mar 11 '15 20:03 ijsf

@pererikb has it locally. Can you please share?

stefanalund avatar Mar 11 '15 20:03 stefanalund

https://github.com/pererikb/openwebrtc/commits/overlay https://github.com/pererikb/bowser/commits/overlay

pererikb avatar Mar 14 '15 05:03 pererikb

Thanks Per-Erik, looks pretty good!

stefanalund avatar Mar 14 '15 08:03 stefanalund

@pererikb Tried it here and forced the overlay to be used so I could test with demo.openwebrtc.io. Unfortunately, the local video frame no longer displays anything.

I get the following message in the output:

gldisplay gstgldisplay.c:182:gst_gl_display_new: Could not create display. user specified (NULL) (platform: (NULL)), creating dummy

ijsf avatar Mar 14 '15 14:03 ijsf