You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After upgrading to v1.9, I was able to observe a significant slowdown for the setTexture method. While I was creating a minimal reproduction demo for setTexture, I noticed that initial load performance also suffered a regression. I imagine this stems from the same issue.
The Codepen above serves as a primitive way to measure load performance. Alternate between version 1.8.0 and 1.9.0 by changing the script tag at the top of the template.
Top left of the view shows the visible model count followed by the duration taken to load those models.
On my machine I am consistently measuring ~1500ms for v1.8 and ~10,000ms for v1.9 for 10 models.
Version
model-viewer: v1.9.0
Browser Affected
Chrome, Win 10 Version 94.0.4606.81 (Official Build) (64-bit)
The overall loading performance seems to be decreasing with 1.9. Experienced on every supported browser. Even with the modelviewer.dev astronaut example on site. So +1
Thank you for the awesome repro @lucadalli! I was just noticing some perf issues with three.js, so I'm going to figure out whether this is something we can work around or needs to get fixed upstream.
I attached a video. Loading the modelviewer.dev page and trying to click the "Editor" href. The model loading seems to block the whole webpage functionallity. Even scrolling the page is blocked.
This looks like a three.js regression; we're looking into it now. I believe the page is interactive while the model downloads, but not while the shader is compiling, and that step has somehow become very slow. On my machine it slowed from 300ms to 700ms, but somehow that windows trace is showing 4,000ms, which is crazy.
@lucadalli It might help to have your repro for the setTexture method as well. I do see a big perf slow-down for 10 identical models (caused by reuploading their textures over and over) but that's the same in 1.8 and 1.9 and just something we apparently hadn't optimized because that's kind of an unusual use case. However, I'm seeing the biggest difference between 1.8 and 1.9 for a single model start-up, having to do (I think) with shader compilation. I have yet to see where setTexture might be having an issue.
I'm not entirely convinced setTexture is the culprit, but the pen above demonstrates a significant slow-down.
1,600ms (v1.8) vs 17,000ms (v1.9) on my Windows machine.
Reopening, since I had to revert the fix since it was causing a bigger problem: #2949. A proper fix is coming in three.js, but it'll take our next release cycle to resolve.
@sprengerst you're welcome to pin to either v1.8 or v1.9.1 until our next release comes, e.g. <script type="module" src="https://unpkg.com/@google/[email protected]/dist/model-viewer.min.js"></script>. It's the holidays, so it'll probably be after the new year.
Activity
sprengerst commentedon Oct 25, 2021
The overall loading performance seems to be decreasing with 1.9. Experienced on every supported browser. Even with the modelviewer.dev astronaut example on site. So +1
elalish commentedon Oct 25, 2021
Thank you for the awesome repro @lucadalli! I was just noticing some perf issues with three.js, so I'm going to figure out whether this is something we can work around or needs to get fixed upstream.
sprengerst commentedon Oct 27, 2021
2021-10-27.11-00-00.mp4
I attached a video. Loading the modelviewer.dev page and trying to click the "Editor" href. The model loading seems to block the whole webpage functionallity. Even scrolling the page is blocked.
Browser Affected
Chrome 95.0.4638.54 (Offizieller Build) (64-Bit)
OS
Windows
elalish commentedon Oct 27, 2021
@sprengerst I can't repro that on my mac it seems. Can you paste in a performance profile of page load from dev tools?
sprengerst commentedon Oct 27, 2021
@elalish Event the profile generation looks like lagging at sec 3. I have experienced the same issue today on a customer's windows pc too.
Here is the video:
https://user-images.githubusercontent.com/6854862/139103794-933233d3-e972-4d41-ab8b-13c685b14705.mp4
Here is the profile:
Profile-20211027T180259.zip
Thanks for the investigation.
elalish commentedon Oct 27, 2021
This looks like a three.js regression; we're looking into it now. I believe the page is interactive while the model downloads, but not while the shader is compiling, and that step has somehow become very slow. On my machine it slowed from 300ms to 700ms, but somehow that windows trace is showing 4,000ms, which is crazy.
elalish commentedon Oct 28, 2021
@lucadalli It might help to have your repro for the setTexture method as well. I do see a big perf slow-down for 10 identical models (caused by reuploading their textures over and over) but that's the same in 1.8 and 1.9 and just something we apparently hadn't optimized because that's kind of an unusual use case. However, I'm seeing the biggest difference between 1.8 and 1.9 for a single model start-up, having to do (I think) with shader compilation. I have yet to see where setTexture might be having an issue.
lucadalli commentedon Oct 28, 2021
@elalish
https://codepen.io/citylights/pen/WNEEeqV
I'm not entirely convinced
setTextureis the culprit, but the pen above demonstrates a significant slow-down.1,600ms (v1.8) vs 17,000ms (v1.9) on my Windows machine.
Performance profile for v1.9:
Profile-20211029T002059.zip
elalish commentedon Oct 28, 2021
Interesting; it's 1,700ms for 1.8 and 2,500ms for 1.9 for me. No 10x, but should still be plenty for debug. Very strange.
elalish commentedon Nov 2, 2021
Reopening, since I had to revert the fix since it was causing a bigger problem: #2949. A proper fix is coming in three.js, but it'll take our next release cycle to resolve.
sprengerst commentedon Nov 3, 2021
Oh no :( thanks for the info.
Can you tell when the next release cycle will happen? It makes whole pages unusable :-/
elalish commentedon Nov 3, 2021
@sprengerst you're welcome to pin to either v1.8 or v1.9.1 until our next release comes, e.g.
<script type="module" src="https://unpkg.com/@google/[email protected]/dist/model-viewer.min.js"></script>. It's the holidays, so it'll probably be after the new year.sprengerst commentedon Nov 3, 2021
@elalish Thank you. Holidays? What country do you live in, I think I should join you. :D