Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading grass image in cloth animation three.js example is slower than Firefox #21843

Open
jdm opened this issue Sep 29, 2018 · 9 comments
Open
Labels
A-content/webgl 3d canvas API I-perf-slow Unnecessary performance degredation.

Comments

@jdm
Copy link
Member

jdm commented Sep 29, 2018

https://threejs.org/examples/webgl_animation_cloth.html

It relies on https://github.com/mrdoob/three.js/blob/dev/src/extras/ImageUtils.js, so it would be worth checking how long that operation takes.

@jdm jdm added I-perf-slow Unnecessary performance degredation. A-content/webgl 3d canvas API labels Sep 29, 2018
@jdm jdm changed the title Loading grass image in cloth animation three.js example is slower than desktop Loading grass image in cloth animation three.js example is slower than Firefox Sep 29, 2018
@nox
Copy link
Contributor

nox commented Oct 1, 2018

Those canvas functions are all pretty naively implemented, with a lot of useless message passing and inefficient vector operations.

@nox
Copy link
Contributor

nox commented Oct 9, 2018

Locally I see that the animation itself is slow, but I don't see it being slower to load.

@nox
Copy link
Contributor

nox commented Oct 9, 2018

Btw this demo complains about a missing extension:

THREE.WebGLRenderer: WEBGL_depth_texture extension not supported.

@nox
Copy link
Contributor

nox commented Oct 11, 2018

Loading the image on Android doesn't seem slow to load, but then if you refresh the page it doesn't load again ever. Did you ever see something like that @jdm?

@jdm
Copy link
Member Author

jdm commented Oct 11, 2018

I have seen that, yes. Are you comparing the loading speed against Firefox?

@nox
Copy link
Contributor

nox commented Oct 15, 2018

So I think the slow function is uploadTexture, but I literally can't measure anything because console.log output doesn't really show up in adb logcat. I'm out of ideas on how to debug Servo on Android. I double checked that the function in which I wrote console.log is actually executed by calling baguette() and then checking that "baguette is not defined" is shown in the output of adb logcat.

@nox
Copy link
Contributor

nox commented Oct 15, 2018

@nox
Copy link
Contributor

nox commented Oct 15, 2018

This function call ends up calling WebGLRenderingContext::prepare_pixels, which wouldn't surprise me if it is slow, given it fetches a 2048x2048 picture and premultiplies it etc.

@nox
Copy link
Contributor

nox commented Oct 16, 2018

This takes ~100ms to execute as I imagined it would.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-content/webgl 3d canvas API I-perf-slow Unnecessary performance degredation.
Projects
None yet
Development

No branches or pull requests

2 participants