webarkit / ARnft

A small javascript library for WebAR with NFT
GNU Lesser General Public License v3.0
219 stars 53 forks source link

Severe performance decrease in the new android chrome 90.0.4430 #170

Open thylacinelol opened 3 years ago

thylacinelol commented 3 years ago

Hi!

I was trying out the demo project last week and it was running great. I was using android chrome 87.0.4280.141 and the main thread ran at ~40fps. (this is the example I'm using: https://github.com/webarkit/ARnft/blob/master/examples/arNFT_video_example.html)

However, since the last chrome update (90.0.4430) I'm getting only ~8fps, which makes the video in the example look very laggy. I already tried on 3 different devices and they all have very low fps.

I tried to install android chrome 87.0.4280.141 again on my phone and fps goes back to ~40fps as it was last week.

Any idea on what's going on here?

kalwalt commented 3 years ago

Hi @thylacinelol welcome to webarkit! No i didn't try with the latest android chrome yet. And honestly i have no idea. Recently i did some changes but i don't think that could be a problem, but can you try with a previuos one 0.8.5 or 0.8.4 and see if the issue persist? Thank you

thylacinelol commented 3 years ago

Hi @kalwalt!

I tried both versions 0.8.5 and 0.8.4 and both have the same issue, so it seems that it's not related to those changes. By the way, I tried other examples (https://github.com/webarkit/ARnft/blob/master/examples/arNFT_gltf_brave_robot_example.html) and here the main thread FPS drops to 8 as well.

However, if I downgrade android chrome to 87 everything works very fast.

thylacinelol commented 3 years ago

The new chrome version is rolling out everywhere making this library work really slow. Is there something we can do to fix this?

Would be great to find out which specific part of this library is the bottleneck and if it's possible to fix it on this library or if it's necessary to open an issue here https://bugs.chromium.org/p/chromium/issues/entry?template=Android%20Issue

kalwalt commented 3 years ago

@thylacinelol i haven't yet tried in the new chrome version, so i have no idea what is causing the issue. Could you try the react version here if it is also affected? ARnft is based on JsartoolkitNFT so if you test also these examples would be great. Thank you!

thylacinelol commented 3 years ago

@kalwalt I tried that link and it also drops to 8 FPS (but works fine with older android chrome versions).

kalwalt commented 3 years ago

@thylacinelol I'm wondering if you see this drops of FPS also with other browsers. The only things that i could suppose that impact the performances are the Three.js upgrade and the jsartoolkitNFT upgrade I will setup when i have time a testing branch with a previuos Three.js version to see if this impact the FPS. If you have other ideas let me know.

thylacinelol commented 3 years ago

@kalwalt I tried this link with android firefox and have good 60 FPS. Also tried on iOS chrome and iOS safari and get 30 FPS there.

kalwalt commented 3 years ago

I added to our www.webarkit.org website the simple jsartoolkitNFT example we should test if also this lib is affected by the same issue.

kalwalt commented 3 years ago

On Chrome 89.0.4389.105 Android 7.1.2 i get 20/25 FPS with ARnft instead with jsartoolkitNFT 30/35 FPS. i will try with the latest chrome instead. Note that i'm testing with a Wiko View, not a very performant device.

kalwalt commented 3 years ago

on Chrome 90.0.4430.91 with the jsartoolkitNFT example i got in the Main thread 7 FPS and in the Worker around 15 FPS, with the ARnft example i got in the Main thread 6/7 FPS and in the Worker around 15 FPS. tested examples here: www.webarkit.org/examples i will try to fill a bug issue in the chrome issue tracker.

thylacinelol commented 3 years ago

Hey, I just tested with the example you made and here are more results:

android chrome v90.0.4430.91 12fps
android chrome v87.0.4280.141 55fps
android firefox v88.1.2 60fps
ios chrome 55fps
ios safari 55fps

Definitely looks like a performance regression bug on new android chrome version.

kalwalt commented 3 years ago

@thylacinelol maybe i have build by mistake the artoolkitNFT_ES6_wasm.js lib with a very old version of emscripten and this may cause the bad performances. I will verify and i will post the results.

kalwalt commented 3 years ago

I have opened a new PR https://github.com/webarkit/jsartoolkitNFT/pull/96 to test if if it is a difference between jsartoolkitNFT in this PR and the version in the master. Testing example https://github.com/webarkit/jsartoolkitNFT/blob/testing-emsdk-2.0.20/examples/ARToolkitNFT_ES6_example.html

kalwalt commented 3 years ago

Live example https://kalwalt.github.io/kalwalt-interactivity-AR/jsartoolkitNFT/ARToolkitNFT_ES6_example.html

thylacinelol commented 3 years ago

Hey @kalwalt, tried the live example on chrome (12 FPS) and firefox (55 FPS).

I opened an issue on chromium, but it was tagged as duplicate and merged into another issue. Sadly I can't see that original issue or the status of it because of a permissions, therefore I have no idea if they are even working on it or not.

kalwalt commented 3 years ago

@thylacinelol thank you for testing and to report in the chromium bug tracker, i saw that Is denied to sera the linked issue.