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.
Topic: Biography Text, Album Info, Picture. www.last.fm (Read 73234 times) previous topic - next topic - Topic derived from Re: WSH Panel Mod scr...
0 Members and 1 Guest are viewing this topic.

Re: Biography Text, Album Info, Picture. www.last.fm

Reply #200
Okay, @lender1257 and @paregistrase can you install the attached version of FSM and tell me if your start up times improve substantially.

Root cause (I believe):
On DLL_PROCESS_ATTACH FSM was calling its own method InitializeSubsystems() which was in turn init'ing OLE, TypeLibEx, Scintilla, Gdi+, ATL, and the RichEditControl. As you can imagine, all of those are somewhat expensive as a bunch of DLLs need to be loaded in, etc.

What I did:
Saved off the HINSTANCE that DllMain receives and then deferred the call to InitializeSubsystems() as the very first line of on_init(). I'm seeing immediate 4-6x improvement in fb2k startup times, and in the 20-30 fb2k restarts since only seen a single slow startup in that entire time (that one was 20s total, but it felt more responsive than in the past -- and my machine is purposefully configured to murder fb2k startup for testing).

Possible this is just a bandaid, but if someone else verifies that this improves the problem I'll put up a PR tonight, and hopefully The_Qwertiest will see it.

Re: Biography Text, Album Info, Picture. www.last.fm

Reply #201
Okay, @lender1257 and @paregistrase can you install the attached version of FSM and tell me if your start up times improve substantially.

Without album list, library tree and kgena_ua's bio

Code: [Select]
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 1952 ms
Spider Monkey Panel v1.4.2-dev+ce39bb09 (Musicbrainz: Musicbrainz by marc2003): initialized in 110 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 50 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 47 ms
User Interface initialized in: 0:02.687677
foo_enhanced_playcount: loaded
Querying last.fm: http://ws.audioscrobbler.com/2.0/xxxxxx
Loading
FFmpeg version: 4.3.1
Startup time : 0:06.497853

before

Code: [Select]
Startup time : 0:15.990977

now

Code: [Select]
Startup time : 0:06.497853

Great difference

 

Re: Biography Text, Album Info, Picture. www.last.fm

Reply #202
With the library tree is the same time with this new version but that I think is normal by the nature of the script but the UI seems to be drawn faster than before.

But this could be a subjetive apreciation by my side.

Re: Biography Text, Album Info, Picture. www.last.fm

Reply #203
Great difference
Thanks for testing!


Re: Biography Text, Album Info, Picture. www.last.fm

Reply #205
hello everyone

what a discussion! i am impressed.
obviously there are now several voices that something doesn't fit with panel or script.
thank you for your interest.

it takes a long time to load on both pcs. that means it can't be the computer alone. only the loading after windows startup. stopping fb and restarting is fast.
windows is always fully loaded, the HDD is running, no other programmes are active.

i did some tests. each with original panel + script and each with changed panel + changed script.
windows was always completely restarted between the tests.

changed kgena_ua-script - quote:
"I have added a counter to the main function, the first 2 times it's called it will do nothing. i.e. in startup it's called 2 times, so it will do nothing and load as fast as possible. The rest, it should work as is. (at least that what happens on my side) "

1 - SMP1.4.1 + kgena_ua (original)
2 - SMP1.4.2(dev...) + kgena_ua (original)
3 - SMP1.4.1 + kgena_ua (changed)
4 - SMP1.4.2 + kgena_ua (changed)

I can only leave the analysis and possible changes to the specialists among you.

Kind regards


Re: Biography Text, Album Info, Picture. www.last.fm

Reply #206
Thanks, that's some very dedicated testing lender. Correct me if I'm wrong but it appears you are launching foobar by clicking on that John Mayer .mp3 right? Obviously that's a completely valid use case, but I'm wondering if that contributes to your slow down?

There are some issues with the dev component I built, as snotlicker has reported some crashes in the FSM thread that I can't reproduce. Hopefully we can figure out a workaround though.

From looking at those debugs and seeing the results I get with the original/modified component, what I believe is happening in is that at some point the UI thread gets starved and begins operating very slowly. It's somewhat of a race condition though, so that if your script finishes its initial load/execution in time it won't bog down the UI startup... which still might take some time. That's what the 4th log shows where this script loaded in .7 seconds, but the UI still took 8.5s to finish.

However if the slow down occurs while processing your script it MUST finish execution first to return control to the UI (that's the entire reason why the slow script popup occurs, because if the script is in an infinite loop the UI becomes unresponsive), so UI display can be delayed an additional long time because of it.

My changes demonstrably seemed to have made things better some of the time, but not all apparently. Also the crashes. I'll keep trying.

Re: Biography Text, Album Info, Picture. www.last.fm

Reply #207
hello mordredKLB

not john mayer, but john mayall. i usually listen to slightly older music.  :D

no, i always press the pause button before i quit fb and the next time i start it.

yes, your change to SMP only made a marginal difference; the script change saved the most time.

a little hardware info:
my 2 pcs were originally windows 8.1 machines. now i'm on windows 10 (20H2). of course the loading process from w8.1 to w10 has slowed down, but i always wait until everything is completely loaded.
the hardware data of my desktop you can find in the picture

greetings

Re: Biography Text, Album Info, Picture. www.last.fm

Reply #208
The changed script he posted adds a simple hack to not fire on metadb on startup. And as I said... it fixes the main problem with the script loading (1/3 of original time), applies in all cases, does not require any exotic change on SMP (although it would be great if it finally works) and relies on simply good coding practices... (which also took 1 minute to apply)

Mordred I appreciate what you tried to improve on SMP, but really... you have tried to solve it using a sledgehammer to crack nuts, without solving the more obvious problems. Hope kgena takes into consideration rewriting the on_meta_db routine, or at least adds a check to not fire it on startup.

Re: Biography Text, Album Info, Picture. www.last.fm

Reply #209
hello mordredKLB

not john mayer, but john mayall. i usually listen to slightly older music.  :D

no, i always press the pause button before i quit fb and the next time i start it.

yes, your change to SMP only made a marginal difference; the script change saved the most time.
Sorry, misread :D

Appeared to be a 4x improvement which is pretty solid and in line with what I'm seeing, but UI time was only improved about a second which is disappointing as mine also drastically improved, even better than the results paregistrase saw. Since I basically couldn't make fb2k start faster than 15-20 seconds (again under tortuous, non-typical conditions) and now it almost always starts in under 5.

Re: Biography Text, Album Info, Picture. www.last.fm

Reply #210
Mordred I appreciate what you tried to improve on SMP, but really... you have tried to solve it using a sledgehammer to crack nuts, without solving the more obvious problems. Hope kgena takes into consideration rewriting the on_meta_db routine, or at least adds a check to not fire it on startup.
:D
As I mentioned much earlier this script is easily band-aided in some ways (although didn't you say 400ms was a "waste" just the other day?) but other scripts can't be. I don't even care about this script because I don't use a biography panel (no offense intended to kgena who put together a very nice looking component).

It's that this and other scripts had no issues at startup with jscript_panel, and they do with FSM. That's the problem that needs to be solved. "Script authors must write all code perfectly to avoid serious slowdowns at startup if they want to use FSM" isn't the best message. Not everyone is an advanced JS coder like yourself, and frankly they shouldn't have to be particularly when this stuff is near instantaneous at every other time except startup.

Re: Biography Text, Album Info, Picture. www.last.fm

Reply #211
@paregistrase and @lender1257 I uploaded a new version that seems safer over in the SMP thread. I think I'm still seeing drastic speed improvements but this point I've pulled so many different levers and tested in so many environments/configs that I can't even tell. :D

One question for you Lender. In the Media Library, how many different paths are you watching (i.e. how many entries are in that dialog). I have a weird feeling that it might be related to why you and I see slowdowns at startup, but marc, regor, kgena and others don't seem to. Probably wrong, but I'm curious.

Re: Biography Text, Album Info, Picture. www.last.fm

Reply #212
@paregistrase and @lender1257 I uploaded a new version that seems safer over in the SMP thread. I think I'm still seeing drastic speed improvements but this point I've pulled so many different levers and tested in so many environments/configs that I can't even tell. :D

No problem. I will make 6 test.
3 with Library Tree changing between the 3 Bio script (Biography v1.1.3 by WilB, Biography: Biography, Covers, Albums, Title, Similar artist, Lyrics info.www.last.fm v14042021 by kgena_ua and Biography: Biography, Covers, Albums, Title, Similar artist, Lyrics info.www.last.fm v01052021 by kgena_ua with profiler (on_metadb_changed modified by regor)
Another 3 without Library tree.

Here we go:

With Library Tree and Biography v1.1.3 by WilB
Code: [Select]
Components loaded in: 0:00.278363
Configuration read in: 0:00.043803
foobar2000 v1.6.5 [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 11521 ms
Spider Monkey Panel v1.4.2-dev+ce39bb09 (Biography: Biography v1.1.3 by WilB): initialized in 145 ms
Musicbrainz: Invalid/missing MBID
Spider Monkey Panel v1.4.2-dev+ce39bb09 (Musicbrainz: Musicbrainz by marc2003): initialized in 116 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 64 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 35 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 38 ms
User Interface initialized in: 0:14.191651
foo_enhanced_playcount: loaded
Querying last.fm: http://ws.audioscrobbler.com/2.0/xxxxxxxx
Loading
FFmpeg version: 4.3.1
Startup time : 0:17.820130

With Library Tree and Biography, Covers, Albums, Title, Similar artist, Lyrics info.www.last.fm v14042021 by kgena_ua

Code: [Select]
Components loaded in: 0:00.297465
Configuration read in: 0:00.040476
foobar2000 v1.6.5 [portable]
Shell hook registration failure: 0
Watching: Z:\media\xxxxxx
Watching: Z:\media\xxxxxx
Spider Monkey Panel v1.4.2-dev+ce39bb09 (Library Tree: Library Tree v2.1.3 by WilB): initialized in 11439 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 2040 ms
Musicbrainz: Invalid/missing MBID
Spider Monkey Panel v1.4.2-dev+ce39bb09 (Musicbrainz: Musicbrainz by marc2003): initialized in 133 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 102 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
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 43 ms
User Interface initialized in: 0:14.211291
foo_enhanced_playcount: loaded
Querying last.fm: http://ws.audioscrobbler.com/2.0/xxxxxxx
Loading
FFmpeg version: 4.3.1
Startup time : 0:18.321023

With Library Tree and Biography: Biography, Covers, Albums, Title, Similar artist, Lyrics info.www.last.fm v01052021 by kgena_ua with profiler (on_metadb_changed modified by regor

Code: [Select]
Components loaded in: 0:00.311536
Configuration read in: 0:00.041207
foobar2000 v1.6.5 [portable]
Shell hook registration failure: 0
Watching: Z:\media\xxxx
Watching: Z:\media\xxxxx
Spider Monkey Panel v1.4.2-dev+ce39bb09 (Library Tree: Library Tree v2.1.3 by WilB): initialized in 11387 ms
Spider Monkey Panel v1.4.2-dev+ce39bb09: profiler (on_metadb_changed): 1388ms
Spider Monkey Panel v1.4.2-dev+ce39bb09 (Biography: Biography, Covers, Albums, Title, Similar artist, Lyrics info.www.last.fm v01052021 by kgena_ua): initialized in 2016 ms
Musicbrainz: Invalid/missing MBID
Spider Monkey Panel v1.4.2-dev+ce39bb09 (Musicbrainz: Musicbrainz by marc2003): initialized in 93 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 98 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
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 35 ms
User Interface initialized in: 0:14.092111
foo_enhanced_playcount: loaded
Querying last.fm: http://ws.audioscrobbler.com/2.0/xxxx
FFmpeg version: 4.3.1
Loading
Startup time : 0:17.885960

A little bit slower than Spider Monkey Panel v1.4.1
Code: [Select]
User Interface initialized in: 0:12.522745

Now removing Library Tree

With Biography v1.1.3 by WilB

Code: [Select]
Components loaded in: 0:00.313590
Configuration read in: 0:00.036073
foobar2000 v1.6.5 [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 20278 ms
Musicbrainz: Invalid/missing MBID
Spider Monkey Panel v1.4.2-dev+ce39bb09 (Musicbrainz: Musicbrainz by marc2003): initialized in 136 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 65 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 39 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 43 ms
User Interface initialized in: 0:20.987454
foo_enhanced_playcount: loaded
Querying last.fm: http://ws.audioscrobbler.com/2.0/?method=user.getRecentTracks&api_key=a1685abe5265b93cf2be4a70d181bf6b&user=lovecraft_last&limit=200&format=json&from=1620993977&page=1
FFmpeg version: 4.3.1
Loading
Startup time : 0:24.645305


With kgena_ua's bio

Code: [Select]
Components loaded in: 0:00.456232
Configuration read in: 0:00.148819
foobar2000 v1.6.5 [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 22202 ms
Musicbrainz: Invalid/missing MBID
Spider Monkey Panel v1.4.2-dev+ce39bb09 (Musicbrainz: Musicbrainz by marc2003): initialized in 95 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 64 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
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 74 ms
User Interface initialized in: 0:22.916863
FFmpeg version: 4.3.1
foo_enhanced_playcount: loaded
Querying last.fm: http://ws.audioscrobbler.com/2.0/xxxxxx
Loading
Startup time : 0:27.181862

With regor modification of kgena_ua's bio

Code: [Select]
Components loaded in: 0:00.285895
Configuration read in: 0:00.036177
foobar2000 v1.6.5 [portable]
Shell hook registration failure: 0
Watching: Z:\media\xxxxx
Watching: Z:\media\xxxxx
Spider Monkey Panel v1.4.2-dev+ce39bb09: profiler (on_metadb_changed): 5614ms
Spider Monkey Panel v1.4.2-dev+ce39bb09 (Biography: Biography, Covers, Albums, Title, Similar artist, Lyrics info.www.last.fm v01052021 by kgena_ua): initialized in 17251 ms
Musicbrainz: Invalid/missing MBID
Spider Monkey Panel v1.4.2-dev+ce39bb09 (Musicbrainz: Musicbrainz by marc2003): initialized in 85 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 70 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 53 ms
User Interface initialized in: 0:17.947067
Loading
foo_enhanced_playcount: loaded
Querying last.fm: http://ws.audioscrobbler.com/2.0/xxxxxx
FFmpeg version: 4.3.1
Startup time : 0:21.618035


Like before if any bios script is the first load the start up times are worse than having Library Tree.

Removing Library Tree and the new version of Spider Monkey is even worse and the warning window of slow script pop up in all of then before the ui was drawn (This never happen to me before, I saw the warning sometimes but never at start up)

Sorry to say that this build (at least in my machine) is slower than your previous modification (that doesn't produce any crash on my side) or the original



Re: Biography Text, Album Info, Picture. www.last.fm

Reply #213
Hello everybody. Thank you for participating in the discussion.

What do I have
Code: [Select]
Spider Monkey Panel v1.4.1: profiler (on_metadb_changed): 146ms
Spider Monkey Panel v1.4.1 (bio: Biography, Covers, Albums, Title, Similar artist, Lyrics info.www.last.fm v01052021 by kgena_ua): initialized in 208 ms
......
Startup time : 0:01.619760
and
Code: [Select]
Spider Monkey Panel v1.4.2-dev+ce39bb09: profiler (on_metadb_changed): 146ms
Spider Monkey Panel v1.4.2-dev+ce39bb09 (bio: Biography, Covers, Albums, Title, Similar artist, Lyrics info.www.last.fm v01052021 by kgena_ua): initialized in 208 ms
......
Startup time : 0:01.552362

I need help.
Please write in simple language and with examples, this is better for me to understand.

Quote
Hope kgena takes into consideration rewriting the on_meta_db routine, or at least adds a check to not fire it on startup.
In what ways can this be done.

Quote
by kgena_ua with profiler (on_metadb_changed modified by regor
Where can i see it modified script.
Sorry. I found it. It bio_test.js
Code: [Select]
Spider Monkey Panel v1.4.2-dev+ce39bb09: profiler (on_metadb_changed): 146ms
Spider Monkey Panel v1.4.2-dev+ce39bb09 (bio: Biography, Covers, Albums, Title, Similar artist, Lyrics info.www.last.fm v01052021 by kgena_ua): initialized in 207 ms
...
Spider Monkey Panel v1.4.2-dev+ce39bb09 (bio_test _by_regor: Biography, Covers, Albums, Title, Similar artist, Lyrics info.www.last.fm v01052021 by kgena_ua): initialized in 170 ms
...
Startup time : 0:01.794936
UR5EQF. Ukraine

Re: Biography Text, Album Info, Picture. www.last.fm

Reply #214
Hello everybody. Thank you for participating in the discussion.


Quote
by kgena_ua with profiler (on_metadb_changed modified by regor
Where can i see it modified script.

From a regor's post in this thread.
https://hydrogenaud.io/index.php?action=dlattach;topic=114686.0;attach=19832

Re: Biography Text, Album Info, Picture. www.last.fm

Reply #215
paregistrase, i see.
Now with SMP 1.4.1
Code: [Select]
Spider Monkey Panel v1.4.1: profiler (on_metadb_changed): 146ms
Spider Monkey Panel v1.4.1 (bio: Biography, Covers, Albums, Title, Similar artist, Lyrics info.www.last.fm v01052021 by kgena_ua): initialized in 208 ms
....
Spider Monkey Panel v1.4.1 (bio_test _by_regor: Biography, Covers, Albums, Title, Similar artist, Lyrics info.www.last.fm v01052021 by kgena_ua): initialized in 169 ms
...
Startup time : 0:01.794910

code by regor faster
UR5EQF. Ukraine

Re: Biography Text, Album Info, Picture. www.last.fm

Reply #216
Sorry to say that this build (at least in my machine) is slower than your previous modification (that doesn't produce any crash on my side) or the original
Hey, thanks for testing. The problem is once the slow script warning pops up your timings are all bad. When that warning appears really ALL script processing stops, but the timer doesn't. If you left the warning up for an hour, and then came back and clicked okay, it would say the script took an hour to load. Increase the slow script timeout in Advanced >> Tools >> FSM >> Performance, to 20-30 seconds or so and maybe do a few more tests? Also probably set it back to 5 or 10 after you're done otherwise you'll be sitting around forever in the case of an infinite loop :)

Re: Biography Text, Album Info, Picture. www.last.fm

Reply #217
Sorry to say that this build (at least in my machine) is slower than your previous modification (that doesn't produce any crash on my side) or the original
Hey, thanks for testing. The problem is once the slow script warning pops up your timings are all bad. When that warning appears really ALL script processing stops, but the timer doesn't. If you left the warning up for an hour, and then came back and clicked okay, it would say the script took an hour to load. Increase the slow script timeout in Advanced >> Tools >> FSM >> Performance, to 20-30 seconds or so and maybe do a few more tests? Also probably set it back to 5 or 10 after you're done otherwise you'll be sitting around forever in the case of an infinite loop :)

I tried to click it as far as pop up but you're right, is a human factor.

No problem making more test, tell me if you need other specific conditions and the test to repeat and i be glad to proceed.

Re: Biography Text, Album Info, Picture. www.last.fm

Reply #218
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.

Re: Biography Text, Album Info, Picture. www.last.fm

Reply #219
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?

Re: Biography Text, Album Info, Picture. www.last.fm

Reply #220
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. :)

Re: Biography Text, Album Info, Picture. www.last.fm

Reply #221
@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.

Re: Biography Text, Album Info, Picture. www.last.fm

Reply #222
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.



Re: Biography Text, Album Info, Picture. www.last.fm

Reply #223
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. 😕

Re: Biography Text, Album Info, Picture. www.last.fm

Reply #224
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....