JohnImril / diablo_web_simple

1 stars 1 forks source link

slow loadtimes after Firefox-fix #5

Open Benman2785 opened 3 days ago

Benman2785 commented 3 days ago

Hi,

on my slow work PC the loadtimes are now very high with diablo_web_simple

in the video i compare on same machine diablo_web_simple (first) and diablo_web (second) https://youtu.be/9hs7DDZdrE0

you can see - it takes like 1min loading the menu and 45s to load a multiplayer game in diablo_web_simple -> while diablo_web is way faster here

even on my home pc (Ryzen 7 5800X3D) it takes 3-5s to load a MP game instead of 2s

Benman2785 commented 3 days ago

https://youtu.be/xpbHxlJuaqs

here on my home PC -> initialising takes 3s instead of under 1s // loading a SP or MP game (the first time in that session) takes 3s instead of under 1s

JohnImril commented 2 days ago

Hi, check now, after clearing data and cache. I hope this is the last bug)

Benman2785 commented 2 days ago

tested it -> with that fix we have no savegames again in Firefox; so i think you should add

if (spawn && !mpq) { await load_diabdat(api, fs); }

again ;)

maybe you find another way to increase wait-time but actually you i can live with the longer load-time as long as i can use Firefox

Benman2785 commented 2 days ago

i added your old fix again and test:

if (spawn && !mpq) { await load_diabdat(api, fs); }

when i first start the game it downloads diabdat.mpq -> but while playing (like re-watching credits, starting a sp/mp game, talking to NPCs it always downloads a chunk of diabdat.mpq (between 1-7mb) -> this is why the loadtimes are bigger.

so instead of using the fully downloaded mpq from cache it downloads chunks

will test now if Chrome behaves the same way too

EDIT: tested chrome -> also behaves mosly like Firefox now firefox still downloads each chunk of diabdat.mpq -> while Chrome uses them from cache

but your old fix is fine = it correctly uses cache and only the first loaded game takes long -> after it is cached it opens fast it also only downloads chunks -> like the intro is ~65mb & when you start a game its another ~60mb that gets cached

so behaviour is fine for Chrome :) i guess its a Firefox bug

Benman2785 commented 2 days ago

now I am 100% sure that slow load is a Firefox problem. I will try to configure nginx correctly and test again.

but you should add you load-fix again: if (spawn && !mpq) { await load_diabdat(api, fs); }

Benman2785 commented 2 days ago

https://support.mozilla.org/en-US/questions/1475203

maybe we get an answer there

Benman2785 commented 1 day ago

https://bugzilla.mozilla.org/show_bug.cgi?id=1932581

JohnImril commented 16 hours ago

added a temporary solution if (!navigator.userAgent.includes("Firefox")) await load_diabdat(api, fs); just so it works for now, I continue to sort out the problem