Revadike / SteamWebIntegration

Integrate your personal Steam information on the web, at your convenience!
MIT License
145 stars 20 forks source link

Optimization #14

Open Eiion opened 5 years ago

Eiion commented 5 years ago

I'm sorry that I can't give you more detail on the issue than that. All I can tell you is that since Tampermonkey asked me to update the scripts - and SteamWebIntegration was the only one getting an update - page loading got terribly slowed down on Steamgifts.

Additionally I'm also using the ESGST extension to load in multiple pages at once. With SWI things always were slower, but still relatively comfortable to use. But since the update it actually is as fast as back in the late 90s, when you had to wait for minutes until everything is loaded and you can even scroll again. I'm not exaggerating, it actually takes several minutes to be able to do anything again on the page. Severy times the browser tab even crashed.

So whatever you did with the update seemed to have massive effects on usability.

EDIT: Tampermonkey also shows "'jQuery' is not defined" in line 62 besides many other issues down the lines.

Revadike commented 5 years ago

Are you sure you are on the latest version - 1.8.1? I've improved the performance in that version.

Eiion commented 5 years ago

The code says "@version 1.8.1" and the Tympermonkey overview also says "Steam Web Integration | 1.8.1". It was last updated 6 hours ago. Before that, sometime in the night/very early morning between wednesday and thursday/thursday.

Here's a screenshot: Download

That's the latest version the updater was giving me. This is the updating URL: https://github.com/Revadike/SteamWebIntegration/raw/master/Steam%20Web%20Integration.user.js

The code of the script on github also says 1.8.1 - so your 8.0.1 was a typo?

Revadike commented 5 years ago

it was a typo

Revadike commented 5 years ago

On what page are u experiencing lag?

Eiion commented 5 years ago

The pages that I did use it on (before I found out that SWI was what caused the lag and switched it off) were the "Groups" giveaways page as well as a single group's giveaways page. It was still okayish with only one page loaded in but got unsuable pretty much right after with endless scrolling enabled and loading in up to 11 pages (though it actually never even made it to eleven pages). Before this was never an issue. Even with several more than just 11 pages this was never an issue until the update.

Revadike commented 5 years ago

Well, before it only executed once and if new stuff gets loaded in the same page it wouldn't be detected. Now every time new links are loaded it executes the function again. So, it would make sense it's more demanding. I can likely be optimized further. Though, I'll have to look into this. Also any help is appreciated!

Eiion commented 5 years ago

Not sure how I could help. I can test new versions, but I guess that's about it as I'm not a programmer.

Semenox commented 5 years ago

HI, here is video with function this scrip now https://youtu.be/Gwd8LuWUi10

Reading its now very slowly. Before maybe two weeks ago was all ok, and all scipt info on this site was loaded instant. Hope this help you find problem.

Revadike commented 5 years ago

HI, here is video with function this scrip now https://youtu.be/Gwd8LuWUi10

Reading its now very slowly. Before maybe two weeks ago was all ok, and all scipt info on this site was loaded instant. Hope this help you find problem.

Well, I'd argue that's fine. Otherwise it may slow down the entire page (like it being freezed).

Revadike commented 5 years ago

Actually I just tested myself and it goes much faster for me. But maybe that's because I have a better PC or something.

Semenox commented 5 years ago

Actually I just tested myself and it goes much faster for me. But maybe that's because I have a better PC or something.

I thing its not about PC. I use this script maybe year and all was ok and instat. If i visited this site, all info was loaded instantly. Now, its this script unusable on web like this with 1000+ games. This start maybe 2-3 update before :( Can you give me link to old version, two months or later? I can test it.

OK, i tried 1.7.7 . This old version dont show some info, bul load on site was instant. I try others version...

Eiion commented 5 years ago

I have to agree with Semenox - before it was basically instant, now it's not. This has nothing to do with our PCs, as at least mine didn't change in the meantime. The only thing that did change though was the script. I had the script running all the time so well, that I didn't even think about maybe disabling it. Since the update though it's always off because of what I've described in the original post.

Semenox commented 5 years ago

After last update its this script slower then last... On barter im must disable it on long games lists.. script freeze Firefox :(

Revadike commented 5 years ago

Todo for optimization:

Semenox commented 5 years ago

Can you try release old version +- from January ? In this time was all ok. Now oldest version dont work.

Revadike commented 5 years ago

Can you try release old version +- from January ? In this time was all ok. Now oldest version dont work.

I don't support old versions. If you like something from an old version to return to the new version, let me know.

Semenox commented 5 years ago

I dont know where are changes in core :) Btw i want try Grease or Violent monkey editors if there scipts run better, but in both script dont work :(

Semenox commented 5 years ago

Next "slow" tip.. https://www.ventusky.com/?p=46.1;26.8;4&l=radar&t=20190829/2200 here if its script active, then move on map its super laggy and unusable. If i turn off SWI all its ok and quick. Seem like script tracks something on every pages or soo...

Revadike commented 5 years ago

In order to support dynamic web pages, it tacks all newly loaded content. Not sure what tip you're offering.

Semenox commented 5 years ago

"tip" i can try find some things what you can help find problem. If its script active, laggy on map what i post.(zooming or move on map its laggy, if its script off its all ok) I dont know what you change in scrip in last half year but something on script create this problems. I write you x time, early was all ok ans script works instantly, fast and without lags. I tried reinstal complete FF, change script manager, turn off addons and milon other things, but nothing dont have efect.

Eiion commented 5 years ago

It seems like semenox is not a native English speaker so obviously he's not offering actual tips @revadike but "tips" obviously is just his slightly off wording to say that "Here's something, what about that issue?". He's apparently just chiming in saying the same as I did, which is that you have changed the code back then and that ever since that update SWI causes very big lag issues as already described by me above in the original post.

Revadike commented 5 years ago

Try https://github.com/Revadike/SteamWebIntegration/releases/tag/V1.9.4 and choose to disable dynamic content. @eiion @Semenox

Eiion commented 5 years ago

What's the differences between disabled, ping and observe? (I couldn't try it, yet.)

Revadike commented 5 years ago

What's the differences between disabled, ping and observe? (I couldn't try it, yet.)

More details here: https://revadike.ga/swi/settings/

Semenox commented 5 years ago

Tried - Disabled (only check once) and............. looks like this fix my problem 🥇 :) I test it more :)

And as Eiion write my english is too bad and i want help but have problem say it right :) I love this script and all i mean in good - not offense or soo :)

Yeaaaah :) On all sites its it now quick and smooth :D Thanks :)

Eiion commented 5 years ago

I tried disabled and that worked fine - unless there's a page with endless loading (i.e. further pages are being displayed when scrolling down). So instead I tried the "Check every 1,5 second" (there's an "s" missing) option and that works well. Though I wouldn't mind if it would check only every 2 or even 3 seconds. So an option to change that time period would be great (until then I've changed line 498 - setInterval(doSWI, 1500); - manually to 3000).

Talking of options, with the update from the original post (I think that was it) the background color for the SWI icons changed as well and unfortunately the settings page has no option to change that to everyone's personal likings. So having no option I'm changing that (line 585 - background: rgba(0, 0, 0, 0.7); - to alpha=0) manually as well and it would be great if you could add that to the settings page along with the options for the other colors.

Thanks for the fix @Revadike !

Revadike commented 5 years ago

I tried disabled and that worked fine - unless there's a page with endless loading (i.e. further pages are being displayed when scrolling down). So instead I tried the "Check every 1,5 second" (there's an "s" missing) option and that works well. Though I wouldn't mind if it would check only ever 2 or even 3 seconds. So an option to change that time period would be great (until then I've changed line 498 - setInterval(doSWI, 1500); - manually to 3000).

Talking of options, with the update from the original post (I think that was it) the background color for the SWI icons changed as well and unfortunately the settings page has no option to change that to everyone's personal likings. So having no option I'm changing that (line 585 - background: rgba(0, 0, 0, 0.7); - to alpha=0) manually as well and it would be great if you could add that to the settings page along with the options for the other colors.

Thanks for the fix @Revadike !

If you'd like to make suggestions outside performance, please create a separate issue for it.

Luckz commented 3 years ago

I have SWI set to "only check once" for performance reasons anyway, and re-run manually on demand, like when ESGST loaded several pages of giveaways. It's not that much trouble to do those two mouse clicks when I need it.

Luckz commented 3 years ago

There's some performance chat in https://github.com/Revadike/SteamWebIntegration/pull/54 , and performance should in general be better as of https://github.com/Revadike/SteamWebIntegration/releases/tag/V1.11.5

Revadike commented 3 years ago

There is one thing I've been thinking about. Should we refresh data only after detection of first steam link/image? This would significantly increase the delay between detection and showing icon. Also, does it even matter? There is a cache system in place. I think there was another reason, but I forgot.

Eiion commented 3 years ago

The thing is, back then, before the update that introduced the issue, the script ran perfectly fine without any noticeable lag even with pages where content gets added on (like with endless scrolling on SG via ESGST). There was no issue at all with that. Then, after the changes in SWI huge lag up to the point of making the script practically unusable to the point where it had to be turned off occurred. So, from how I understand what you are saying, removing the refresh feature at all would break the script for long continuously loading pages and only show info for the first page. Which would be a very big step back... again, as far as I understand what you're saying. But, if I got that right... yes, it matters. As the update introducing the issues in the original post showed cache apparently didn't help.

Revadike commented 3 years ago

Can you tell me which versions you're comparing?

Luckz commented 3 years ago

@Eiion I meant to say that using the userscript manager menu (in Chrome/Tampermonkey also available via right-click into the page now), you can manually re-run SWI after you let endless scrolling load all the items you want.