Neos-Metaverse / NeosPublic

A public issue/wiki only repository for the NeosVR project
197 stars 9 forks source link

Asset loading very slow #3388

Open AdmiralSoap opened 2 years ago

AdmiralSoap commented 2 years ago

Describe the bug?

Since the LNL update loading assets has gotten really slow for me. Before loading my simple home world was less than a minute, after clearing cache it takes me over 10 minutes to load. I've been monitoring my internet so it's not an issue with my internet speed.

Relevant issues

Couldn't find any relevant issues regarding slow loading.

To Reproduce

I have heard from others having the issue as well.

Expected behavior

Figuring out why asset loading has been slowing down for some people.

Log Files

No response

Screenshots

No response

How often does it happen?

Always

Does the bug persist after restarting Neos?

Yes

Neos Version Number

2021.11.10.1265

What Platforms does this occur on?

Windows

Link to Reproduction Item/World

No response

Did this work before?

Yes

If it worked before, on which build?

2021.10.21.64

Additional context

No response

Reporters

Soap / AdmiralSoap#4934

shadowpanther commented 2 years ago

Assets are not loading via LNL, rather via HTTPS, but I also noticed that assets are taking a significant amount of time to load. Most of the time is lost on connection negotiation with the server, the asset transfer itself is pretty fast. But as there are a lot of small assets like mipmap variants of textures, all those connection times are adding up. I have suggested bunching the assets in bigger chunks to mitigate that to a degree.

Enverex commented 2 years ago

This would be a non-issue with HTTP/2 but unfortunately .NET doesn't seem to support it, despite the fact it's been around for a long time now with a large amount of the internet having switched over to it. I wonder if there's some way Neos could use another mechanism to sidestep .NET/Mono's limitation there as it could be a lot faster than it currently is.

clarjon1 commented 2 years ago

I did find this info from 2017 about updating Mono's webrequest, if it's any help:

Host/Runtime | Backend -- | -- Windows/.NET Framework | HttpWebRequest Windows/Mono | HttpWebRequest Windows/UWP | Windows native WinHttpHandler (HTTP 2.0 capable) Windows/.NET Core | Windows native WinHttpHandler (HTTP 2.0 capable) Android/Xamarin | Default to Android’s HTTP transportCan be configured to be HttpWebRequest. iOS, tvOS, watchOS/Xamarin | Default to NSUrlSession (HTTP 2.0 capable)Can be configured to use HttpWebRequest. macOS/Xamarin | Default to NSUrlSession (HTTP 2.0 capable)Can be configured to use HttpWebRequest macOS/Mono | HttpWebRequest macOS/.NET Core | libcurl-based HTTP transport (HTTP 2.0 capable) Linux/Mono | HttpWebRequest Linux/.NET Core | libcurl-based HTTP transport (HTTP 2.0 capable)
SUPTEC-Gourry commented 2 years ago

Also notice the slowness in loading assets from the Neos Cloud. Didn't had this performance issue when the cloud CDN was Azure.

ProbablePrime commented 2 years ago

@AdmiralSoap Gonna need some logs from you Please.

AdmiralSoap commented 2 years ago

DESKTOP-M3LTEEK - 2022.1.28.1310 - 2022-02-21 13_02_08.log

I went around on desktop hopping to worlds. The last one had two users in it.

ProbablePrime commented 2 years ago

You da best. I'll take a look tommorrow.

ProbablePrime commented 2 years ago

From Enverex: Another interesting thing in your logs, other than a load of broken cubemaps due to the asset variant system not working properly at the moment, it looks like it's also issuing you bad standard textures too now? 13.10.53.776 ( 40 FPS) Exception decoding texture asset: C:/Users/ADMIRA~1/AppData/Local/Temp/Solirax/NeosVR\Cache\ltyhnzzs6g4j0pwf Variant: Type: Texture2D, FilterMode: Anisotropic, Aniso: 16, WrapU: Clamp, WrapV: Clamp, WrapW: Repeat, MipMapBias: 0, Readable: False, Exact: False, Compression: BC3_LZMA, Quality: 100, Width: 96, Height: 96, Mipmaps: False, Filtering: Bilinear VariantIdenfifier: version=2&compression=BC3_LZMA&quality=100&width=96&height=96&mips=False&filtering=Bilinear System.IO.InvalidDataException: Version is too new: 1 at CodeX.Bitmap2D.LoadRaw (System.IO.Stream stream) [0x00044] in <9305dcafe5b3481fab676401a77501cd>:0 at CodeX.Bitmap2D.LoadRaw (System.String file) [0x00007] in <9305dcafe5b3481fab676401a77501cd>:0 at FrooxEngine.Texture2D.DecodeFile (System.String file, FrooxEngine.Texture2DVariantDescriptor descriptor, System.Boolean forceMips) [0x000a3] in :0 at FrooxEngine.Texture`5+d__37[E,D,C,M,B].MoveNext () [0x005c5] in :0

AdmiralSoap commented 2 years ago

DESKTOP-M3LTEEK - 2022.1.28.1335 - 2022-05-22 09_51_16.log

My log from joining Epsilion's world. There were few assets and only people. I sat in a checkerboard void for about 10 minutes... Joined the world around 9:55. Meshes seem to load perfectly fine. But it's the textures there are issues. Hopefully the logs show anything!

BlueTera commented 2 years ago

I also have this problem.

Zyro1331 commented 2 years ago

Same, I have some asset heavy worlds that take pretty much 15 minutes on a moderate connection. I've kept clearing my cache in hopes that it'll clean up any broken files that are somehow halting the loading frequently, but usually it takes much less time to regenerate all that content (about four minutes to get all the UI facets and home world items initialized and fully functional after a cache purge) I've never timed it as I thought I was the only one having the issue at the time, but it seems to be a little more common than I thought.

Zyro1331 commented 2 years ago

ZY-MANGOVRG - 2022.1.28.1335 - 2022-05-23 06_53_46.log Here's the latest log, here's all I did in that short play time.

  1. Cleaned cache and booted into cloud home and waited for Dash and Cloud Home to load. (6:54 AM)
  2. Opened worlds menu, and joined ReSync Lounge. (6:55 AM)
  3. Stood still in the spawn area for about four minutes. (Loading ended at 6:59 AM)
  4. Left the world after done loading (Left at 6:59 AM)
  5. Saved and Exited out of Neos (Started at 7:02 AM - Ended at 7:04 AM)

It took two minutes just to exit Neos, because the Ender environment floor was all null texture until that finished loading. Then finally the Syncing began and then Neos closed.

AdmiralSoap commented 2 years ago

I went to Appdata/LocalLow/Solirax and deleted the NeosVR folder. After relogging and resetting my settings the loading seems to be way faster! I'll be sending this tip to others who have this issue and if it fixes it for them I will close this issue!

shiftyscales commented 2 years ago

I wouldn't advise closing the issue necessarily- there is likely still some underlying reason that could eventually be sussed out if all other variables but the local database are the same (approximate time of connection/network conditions, etc.)

Enverex commented 2 years ago

Indeed, that's not a fix, that's a workaround as it involves deleting all your local content.

Liltoro commented 2 years ago

Had these issues for awhile- deleting the NeosVR folder in local low data improves loading speed- though it does require ya to relogin, other than that it works as intended for the time being

ModernBalloonie commented 1 year ago

Had these issues for awhile- deleting the NeosVR folder in local low data improves loading speed- though it does require ya to relogin, other than that it works as intended for the time being

Yup! This happened to me and I did exactly this, It fixed the issue!

Zyro1331 commented 1 year ago

I had this issue again recently and can confirm the fix works.

In my theory, it's something to do when you are deleting the "Main cache" folder from AppData\Local\Temp\Solirax\NeosVR\Cache possibly causing some mismatching between the two locations. Removing AppData\LocalLow\Solirax\NeosVR after the "Main cache" did indeed help loading time a ton, seeing the performance improvements feels like night and day. Thanks for the help!

ProbablePrime commented 1 year ago

Saw Zyro's comment recently and wanted to provide information: https://wiki.neosvr.com/Neos_Data_Folders

There is only one cache.

Zyro's second location is the database/data folder, which is different.

zahndy commented 1 year ago

I saw this issue come by in the discord and it got me curious as things have been loading slower than usual for a while. This started around January or earlier but wasn't a complete showstopper, things just took longer and i got somewhat used to it. So today I looked at the cache folder and it had about 50K files totaling about 6GB, This is with the "CacheGetClapped" mod installed. After clearing the folder the difference is almost night and day, my biggest worlds loaded faster un-cached than when they were cached. This could also explain why it took me so long to join the MMC23 Ceremony world.

This workaround is not a fix because it can happen again and the true cause has not been found.

Enverex commented 1 year ago

Clearing the cache didn't work for me, I had to delete my entire local folder (and database) to get it back to normal speed - which also has the side-effect of losing all local content.

shiftyscales commented 1 year ago

I saw some recent discussion around this topic, and a user had discovered/had success with forcing a database repair. So that is something that could be tried first before a nuclear option, @zahndy @Enverex.

https://wiki.neos.com/Database_repair

shadowpanther commented 1 year ago

success with forcing a database repair

Does the repair, accidentally, also prune/compress the database? Because that might explain the performance gain. If so, then triggering a repair might also be a workaround for #2473.

shiftyscales commented 1 year ago

Just checked in with Frooxius on this, @shadowpanther.

Yes it will prune the database and remove a lot of cruft.

The database gets bloated over time.

So it may help with your linked issue too