Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Recent Posts
1
3rd Party Plugins - (fb2k) / Re: Biography Text, Album Info, Picture. www.last.fm
Last post by MordredKLB -
The script that its first loaded takes a long time. And no mathers if is a script that do a lot of things (library tree) or one that in theory would not have to do much like a panel of bio with the info to shown downloaded already.
That's what I've been trying to say, and why approached it from the other non-script side.

Code: [Select]
When loaded after UI is visible:
Spider Monkey Panel v1.4.2-dev+ce39bb09 (Search by Distance Buttons: Search by Distance Buttons by xxx): initialized in 67 ms
When it's 100x slower at startup, it's probably not the script's fault :) Ultimately I think FSM just needs to load more stuff than JSP did, and if your script doesn't win the race to finish before stuff starts being loaded and execution slows to a crawl then you're out of luck. FSM would need a major refactor to solve that one (delaying loading until something is actually used) and I'm not competent enough to do that.
2
3rd Party Plugins - (fb2k) / Re: Biography Text, Album Info, Picture. www.last.fm
Last post by paregistrase -
Great work. Seems like the test component made very little difference for you. You can also see that which script gets caught in the UI thread starvation slowdown changes every time which was kind of my original point in this whole discussion: that kgena's script wasn't really the culprit, but whatever.

This makes me thinks when I saw it.

The script that its first loaded takes a long time. And no mathers if is a script that do a lot of things (library tree) or one that in theory would not have to do much like a panel of bio with the info to show downloaded already.
3
3rd Party Plugins - (fb2k) / Re: Biography Text, Album Info, Picture. www.last.fm
Last post by MordredKLB -
In my machine your new version is slower but your previous version was faster than stock and didn't produced crashes.
I would expect the first dev version to be faster than the 2nd, because I had to move things back up in the startup stack. If that really did make a difference it probably went right back to slowing things down. Unless lender sees any improvements this experiment is probably DOA. I still think it's faster on my machine, but I barely know what I'm doing anymore. Probably placebo or I changed something else.

Quote
A clean portable install with only spider monkey, no library and only one script loaded maybe?
In my experience this is usually enough to get the script to finish execution very very fast (<1s in my test today). But that's not super helpful since nobody runs fb2k like that.

BTW, @regor will probably think this is the ultimate shitpost, but I just keep beating the same dead horse:
Code: [Select]
Spider Monkey Panel v1.4.2-dev+ce39bb09 (Last.fm Bio: Biography, Covers, Albums, Title, Similar artist, Lyrics info.www.last.fm v01052021 by kgena_ua): initialized in 2262 ms
User's music_graph_descriptors - File loaded: D:\Source\foobar2000_portable\scripts\SMP\xxx-scripts\helpers\music_graph_descriptors_xxx_user.js
User's music_graph_descriptors has been loaded but it contains no changes... using only default one.
music_graph_descriptors_xxx: Basic debug enabled
music_graph_descriptors_xxx: Advanced debug enabled
Spider Monkey Panel v1.4.2-dev+ce39bb09 (Search by Distance Buttons: Search by Distance Buttons by xxx): initialized in 5731 ms
User Interface initialized in: 0:08.871954
I'll save him the speech about needing to spend time optimizing his code though. ;)
4
3rd Party Plugins - (fb2k) / Re: Biography Text, Album Info, Picture. www.last.fm
Last post by paregistrase -
Great work. Seems like the test component made very little difference for you. You can also see that which script gets caught in the UI thread starvation slowdown changes every time which was kind of my original point in this whole discussion: that kgena's script wasn't really the culprit, but whatever.

I guess you didn't compare those times vs the stock 1.4.1 FSM (unless they're in a different post?), but my guess is it probably doesn't change much. Bummer. It definitely appears to be a lot faster on my machine but there's so much variation it might just be random noise. 😕

This

This is the first before testing differents versions.

Was made with my previous setup

1.4.1 library tree and WilB's bio.

User Interface initialized in: 0:12.522745 vs Startup time : 0:17.820130

In my machine your new version is slower but your previous version was faster than stock and didn't produced crashes.

Like you say there some many noise and different setups to make a clear clonclusion.

Thats why I asked you if there are any specific conditions to reduce this noise and gives more clear results.

A clean portable install with only spider monkey, no library and only one script loaded maybe?

Don't know, say me....
6
3rd Party Plugins - (fb2k) / Re: Biography Text, Album Info, Picture. www.last.fm
Last post by MordredKLB -
Great work. Seems like the test component made very little difference for you. You can also see that which script gets caught in the UI thread starvation slowdown changes every time which was kind of my original point in this whole discussion: that kgena's script wasn't really the culprit, but whatever.

I guess you didn't compare those times vs the stock 1.4.1 FSM (unless they're in a different post?), but my guess is it probably doesn't change much. Bummer. It definitely appears to be a lot faster on my machine but there's so much variation it might just be random noise. 😕
7
3rd Party Plugins - (fb2k) / Re: Biography Text, Album Info, Picture. www.last.fm
Last post by paregistrase -
So, no need to test both.

Better the original or the modified?
I care about the one that is the slowest because that's what I'm trying to improve on. :)

Not contradictory at all  8)

Second round. Reboot in between timer 30 sec

With library tree Biography: Biography v1.1.3 by WilB

Code: [Select]
Components loaded in: 0:00.279650
Configuration read in: 0:00.060239
foobar2000 v1.6.6 beta 8 [portable]
Shell hook registration failure: 0
Watching: Z:\media\xxxxx
Watching: Z:\media\xxxxx
Spider Monkey Panel v1.4.2-dev+ce39bb09 (Library Tree: Library Tree v2.1.3 by WilB): initialized in 11437 ms
Spider Monkey Panel v1.4.2-dev+ce39bb09 (Biography: Biography v1.1.3 by WilB): initialized in 147 ms
Spider Monkey Panel v1.4.2-dev+ce39bb09 (Musicbrainz: Musicbrainz by marc2003): initialized in 153 ms
Spider Monkey Panel v1.4.2-dev+ce39bb09 (Last.fm Similar Artists + User Charts + Recent Tracks: Last.fm Similar Artists + User Charts + Recent Tracks by marc2003): initialized in 59 ms
Spider Monkey Panel v1.4.2-dev+ce39bb09 (Last.fm Similar Artists + User Charts + Recent Tracks: Last.fm Similar Artists + User Charts + Recent Tracks by marc2003): initialized in 36 ms
Spider Monkey Panel v1.4.2-dev+ce39bb09 (Last.fm Similar Artists + User Charts + Recent Tracks: Last.fm Similar Artists + User Charts + Recent Tracks by marc2003): initialized in 37 ms
User Interface initialized in: 0:12.405669
foo_enhanced_playcount: loaded
Querying last.fm: http://ws.audioscrobbler.com/2.0/xxxxx
FFmpeg version: 4.3.1
Loading
Startup time : 0:16.081855

With library tree Biography: Biography, Covers, Albums, Title, Similar artist, Lyrics info.www.last.fm v14042021 by kgena_ua

Code: [Select]
Components loaded in: 0:00.285051
Configuration read in: 0:00.052151
foobar2000 v1.6.6 beta 8 [portable]
Shell hook registration failure: 0
Watching: Z:\media\xxxxx
Watching: Z:\media\xxxxx
Spider Monkey Panel v1.4.2-dev+ce39bb09 (Library Tree: Library Tree v2.1.3 by WilB): initialized in 11463 ms
Spider Monkey Panel v1.4.2-dev+ce39bb09 (Biography: Biography, Covers, Albums, Title, Similar artist, Lyrics info.www.last.fm v14042021 by kgena_ua): initialized in 1536 ms
Spider Monkey Panel v1.4.2-dev+ce39bb09 (Musicbrainz: Musicbrainz by marc2003): initialized in 108 ms
Spider Monkey Panel v1.4.2-dev+ce39bb09 (Last.fm Similar Artists + User Charts + Recent Tracks: Last.fm Similar Artists + User Charts + Recent Tracks by marc2003): initialized in 66 ms
Spider Monkey Panel v1.4.2-dev+ce39bb09 (Last.fm Similar Artists + User Charts + Recent Tracks: Last.fm Similar Artists + User Charts + Recent Tracks by marc2003): initialized in 41 ms
Spider Monkey Panel v1.4.2-dev+ce39bb09 (Last.fm Similar Artists + User Charts + Recent Tracks: Last.fm Similar Artists + User Charts + Recent Tracks by marc2003): initialized in 48 ms
User Interface initialized in: 0:13.709322
FFmpeg version: 4.3.1
foo_enhanced_playcount: loaded
Querying last.fm: http://ws.audioscrobbler.com/2.0/xxxxx
Loading
Startup time : 0:17.813086
Auto Check for Updates: next check is scheduled for 2021-05-20 23:46:44


No library Tree Biography: Biography v1.1.3 by WilB

Code: [Select]
Components loaded in: 0:00.282568
Configuration read in: 0:00.049214
foobar2000 v1.6.6 beta 8 [portable]
Shell hook registration failure: 0
Watching: Z:\media\xxxxx
Watching: Z:\media\xxxxx
Spider Monkey Panel v1.4.2-dev+ce39bb09 (Biography: Biography v1.1.3 by WilB): initialized in 16335 ms
Spider Monkey Panel v1.4.2-dev+ce39bb09 (Musicbrainz: Musicbrainz by marc2003): initialized in 149 ms
Spider Monkey Panel v1.4.2-dev+ce39bb09 (Last.fm Similar Artists + User Charts + Recent Tracks: Last.fm Similar Artists + User Charts + Recent Tracks by marc2003): initialized in 44 ms
Spider Monkey Panel v1.4.2-dev+ce39bb09 (Last.fm Similar Artists + User Charts + Recent Tracks: Last.fm Similar Artists + User Charts + Recent Tracks by marc2003): initialized in 40 ms
Spider Monkey Panel v1.4.2-dev+ce39bb09 (Last.fm Similar Artists + User Charts + Recent Tracks: Last.fm Similar Artists + User Charts + Recent Tracks by marc2003): initialized in 42 ms
User Interface initialized in: 0:17.043556
FFmpeg version: 4.3.1
foo_enhanced_playcount: loaded
Querying last.fm: http://ws.audioscrobbler.com/2.0/xxxxx
Loading
Startup time : 0:20.840203
Auto Check for Updates: next check is scheduled for 2021-05-20 23:46:44
Autobackup: Backed up 80 items to autobackup.20210515-085516.zip

No library Tree Biography: Biography, Covers, Albums, Title, Similar artist, Lyrics info.www.last.fm v14042021 by kgena_ua

Code: [Select]
Components loaded in: 0:00.285547
Configuration read in: 0:00.042126
foobar2000 v1.6.6 beta 8 [portable]
Shell hook registration failure: 0
Watching: Z:\media\xxxxx
Watching: Z:\media\xxxxx
Spider Monkey Panel v1.4.2-dev+ce39bb09 (Biography: Biography, Covers, Albums, Title, Similar artist, Lyrics info.www.last.fm v14042021 by kgena_ua): initialized in 12808 ms
Spider Monkey Panel v1.4.2-dev+ce39bb09 (Musicbrainz: Musicbrainz by marc2003): initialized in 112 ms
Spider Monkey Panel v1.4.2-dev+ce39bb09 (Last.fm Similar Artists + User Charts + Recent Tracks: Last.fm Similar Artists + User Charts + Recent Tracks by marc2003): initialized in 81 ms
Spider Monkey Panel v1.4.2-dev+ce39bb09 (Last.fm Similar Artists + User Charts + Recent Tracks: Last.fm Similar Artists + User Charts + Recent Tracks by marc2003): initialized in 37 ms
Spider Monkey Panel v1.4.2-dev+ce39bb09 (Last.fm Similar Artists + User Charts + Recent Tracks: Last.fm Similar Artists + User Charts + Recent Tracks by marc2003): initialized in 40 ms
User Interface initialized in: 0:13.487204
Loading
foo_enhanced_playcount: loaded
Querying last.fm: http://ws.audioscrobbler.com/2.0/xxxxx
FFmpeg version: 4.3.1
Startup time : 0:17.611214
Auto Check for Updates: next check is scheduled for 2021-05-20 23:46:44
Autobackup: Backed up 80 items to autobackup.20210515-090015.zip

A little better.

But the Pattern seems similar. Faster when library tree is present.


8
3rd Party Plugins - (fb2k) / Re: Biography Text, Album Info, Picture. www.last.fm
Last post by MordredKLB -
@kgena_ua I made some modifications to your script to improve performance.

Biggest one is this, on_metadb_changed only updates bio data if the current metadb (either currently playing or playlist selected) is in the handle_list:
Code: [Select]
function on_metadb_changed(handles, fromhook) {
    if (!panel_on) return;
    if (!metadb) return;
    if (handles.Count > 0) {
        handles.Sort();
        if (handles.BSearch(metadb) > -1) {
            // only update data if current metadb is in list of handles
            updateBioData();
        }
    }
}

function updateBioData() {
    ini_data();
    // continues as normal from here
Then I replaced all calls of "on_metadb_changed()" that you were manually making with "updateBioData()" so they still get called everytime.
Lastly I replaced the duplicate remap artist call in ini_data:
Code: [Select]
    meta_artist = remap_artist(tf_artist);
    meta_album = remap_album(meta_artist, tf_album);

There are probably some other optimizations you could make (I didn't look through it much) but that's going to take care of the most important things.
10
3rd Party Plugins - (fb2k) / Re: Biography Text, Album Info, Picture. www.last.fm
Last post by paregistrase -
From a regor's post in this thread.
https://hydrogenaud.io/index.php?action=dlattach;topic=114686.0;attach=19832
code by regor faster


Guys, regors code isn't faster. He made zero optimizations, just logged out how long two functions take (if they are slow) :D
It's the exact same code as kgena last copy in here otherwise.

So, no need to test both.

Better the original or the modified?
SimplePortal 1.0.0 RC1 © 2008-2021