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 30536 times) previous topic - next topic - Topic derived from Re: WSH Panel Mod scr...
MordredKLB and 2 Guests are viewing this topic.

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

Reply #150
hello kgena_ua

i have switched to spider monkey panel.
could not find any errors so far.
it all works very well.
congratulations - good job !!

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

Reply #151
now something has turned up after all:
although i have already clicked on "don't ask me again",
this message almost always comes up when fb starts up.

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

Reply #152
now something has turned up after all:
although i have already clicked on "don't ask me again",
this message almost always comes up when fb starts up.
lender1257,
At what point did it happen ?
I.m. UR5EQF

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

Reply #153
hello kgena_ua
this happens to me on both pcs when i start foobar for the first time.
if i then quit foobar and start it again, the message does not appear.
no other program is open.
I have attached the two console logs. maybe it will help you.

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

Reply #154
lender1257, greetings.
Your initialization time is too long.
I have
I.m. UR5EQF


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

Reply #156
Quote
now something has turned up after all:
lender1257,
does this happen if only the "artist" menu item is selected?
I.m. UR5EQF

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

Reply #157
hi

i have switched off everything, but the message still comes up.
the problem: loading takes too long for SMP.
foobar has to read more than 20,000 tracks, covers, including some filters and statistics. the startup also took a little while under WSH. but it wasn't really a problem.
I have no idea how to test your script, because first the message appears and only after answering it, foobar is loaded.

PS: pm me if you want
     i'll be back later afternoon

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

Reply #158
hello kgena_ua

i think your script is ok. i have tested with both of my pcs.
the message actually only appears the first time foobar is started after windows has been restarted. most of the time; but i've also managed not to get the message!
and that's probably because both pcs are a bit slow. maybe there's also a timer in the SMP (not your script) that has expired and that's why this message appears.
Anyway, I can live with it.

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

Reply #159
hello kgena_ua

can you please change your script to create console entries. or can i do that with the SMP anyway. i haven't found anything.
I would like to know what is displayed in the script when the message comes up.
as "regor" meant. https://hydrogenaud.io/index.php?topic=116669.msg997030#msg997030

thank you

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

Reply #160
hello kgena_ua

can you please change your script to create console entries. or can i do that with the SMP anyway. i haven't found anything.
I would like to know what is displayed in the script when the message comes up.
as "regor" meant. https://hydrogenaud.io/index.php?topic=116669.msg997030#msg997030

thank you
You don't have to do anything in that case, just press stop. It will crash and show you the lines

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

Reply #161
hello regor

I don't know any stop button.
I tried the following whenever the message came up:
stop script, pause key, ctrl pause key
no crash !?

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

Reply #162
I have catch it.
Quote
I don't know any stop button.

lender1257
I.m. UR5EQF

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

Reply #163
I have catch it.
Quote
I don't know any stop button.

lender1257
Exactly. Pressing stop will break execution, crash the panel and then a popup will appear with the problematic lines.

Then post that error for @kgena_ua

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

Reply #164
thanks guys

I have done this a few times, but no crash.
today i do it again and, a crash ...




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

Reply #165
Replace panel with attached file. Should show on console the file(s) which produce the slow down and maybe you can find some errors on those (?).

Supposing that's the problem, I find too strange that sometimes it takes 3 secs for you and other times 30 secs (how much time was taking before?). That could point to an HDD error on your side, while retrying reading the block.

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

Reply #166
hello regor

before i switched to SMP, fb took about 10 seconds to start. (estimated).
i don't think it's the hard drive. the message comes on 2 different machines.
i've tested HDD with CrystalDisk-Info - HDD is good
sometimes there is no message at all (as before).

attached is the console of bio_test.js

as soon as windows 10 21H1 comes, i will do an "inplace upgrade". maybe that will help.

thank you

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

Reply #167
The script is taking too much time, but not specially at that point (although 300 ms to just read a text file seems excessive). You stopped the script at that point before, but there must be other places which take more time. 14 secs is too much, so kgena_ua will have to add profilers at multiple points to see where the problem is. SMP is supposed to be faster, so it may be that some code is not optimal and you have a large database which exacerbates the problem.

@kgena_ua  Btw the fso calls  can be replaced with this on SMP
Code: [Select]
utils.IsFile(file);
utils.IsDirectory(folder);

And providing codepage on ReadTextFile would be faster.


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

Reply #168
@kgena_ua  Btw the fso calls  can be replaced with this on SMP
Code: [Select]
utils.IsFile(file);
utils.IsDirectory(folder);
And providing codepage on ReadTextFile would be faster.
regor, thanks.

Quote
kgena_ua will have to add profilers at multiple points to see where the problem is
what is it.
I'm sorry I'm not English speaking. sometimes there are problems in understanding.
I.m. UR5EQF

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

Reply #169
@kgena_ua  Btw the fso calls  can be replaced with this on SMP
Code: [Select]
utils.IsFile(file);
utils.IsDirectory(folder);
And providing codepage on ReadTextFile would be faster.
regor, thanks.

Quote
kgena_ua will have to add profilers at multiple points to see where the problem is
what is it.
I'm sorry I'm not English speaking. sometimes there are problems in understanding.
Dont worry, ask me anything you don't understand.

Code: [Select]
var profiler = new FbProfiler('MY CODE 1');
.... code 1 that might be slow
profiler.Print();
...
var profiler = new FbProfiler('MY CODE 2');
.... code 2 that might be slow
profiler.Print();
-> on console
Code: [Select]
[17:31:01] Spider Monkey Panel v1.4.1-dev+0f2108d4: profiler (MY CODE 1): 10ms
[17:31:01] Spider Monkey Panel v1.4.1-dev+0f2108d4: profiler (MY CODE 2): 1500ms
// Code 2 may have problems?
That will show you why your code is slow t in SMP.

More notes:
  • create_history_array -> add profiler?
  • load_json_data -> add profiler?, add codepage to utils.readText (faster)
  • save_json_data -> replace fso with utils.writeText and force codepage utf-8 (faster)

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

Reply #170
before i switched to SMP, fb took about 10 seconds to start. (estimated).
i don't think it's the hard drive. the message comes on 2 different machines.
First of all, the "slow script" message doesn't persist between foobar starts (with good reason). Saying don't show this again only lasts until you restart.

Second when you start up foobar and it takes a long time to load, what happens if you immediately close foobar and then start again? Does it still take 10+ seconds, or is it much faster? When my HDD is not spinning or if I'm doing something else on another drive foobar can take a long time to start for me too. That's why if you're trying to check startup time you should always start foobar, then shut down and immediately restarting before checking the start up times It will remove at least one variable.

@kgena_ua :
Regor is correct the Utils.IsFile and Utils.WriteText will probably be "faster" but honestly we're talking speeds that are unlikely to matter. If fso.WriteFile ever takes more than 10ms something's most likely going on that doesn't have anything to do with the script. I tested it and I get 0ms pretty much every single time. Loads are essentially the same. This kind of optimization only really matters when you're trying to process hundreds of files in a loop, or writing massive amounts of data. In my opinion, fso is unlikely to be the culprit, although it can easily be replaced.

BTW, if you're concerned about the encoding, when you do utils.WriteTextFile the encoding is always UTF-8, so you'd want to pass 65001 as the codepage for utils.ReadTextFile.

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

Reply #171
hello MordredKLB

for clarification:
both computers are affected.

windows startup is completely done. HDD is running. no other programs are started.
starting fb for the first time --> 10+ seconds + script message.
if i stop fb and start it again immediately, it takes about 3 seconds and the message doesn't come up.
obviously there is still enough information in the memory.
hard disk is running!

another problerm (for example):
when the script from kgena_ua accesses the lastfm-db, the music continues to play, but fb freezes completely until the data from lastfm is displayed. (7-8 seconds)

@kgena_ua:
i do believe (although my music db is not small) that it's the script.
please have a look at WilB's bio-script, maybe you'll find something there that you can take over into your script and thus achieve an improvement.
you do it !

greetings

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

Reply #172
windows startup is completely done. HDD is running. no other programs are started.
starting fb for the first time --> 10+ seconds + script message.
if i stop fb and start it again immediately, it takes about 3 seconds and the message doesn't come up.
obviously there is still enough information in the memory.
The entire reason this is happening then is because it's loading your media library (which you admit is not small). At first startup foobar needs to read the hashes of every single directory in your library to ensure that nothing changed, and compare it to it's database, and then update changed files as needed. At second start that database is already in memory, and maybe directory hashes have been cached somewhere in the drive's buffer to cut down on reads. I don't know why it'd be so much faster, but it is.

At second startup this doesn't take as long. Again, this isn't really a problem with the script so much as an issue with FSM's execution being blocked. All the code optimizations in the world aren't going to solve this because the script isn't actually doing anything for large periods of time, and yet FSM's 10second slow script timer is still going.

I had the same exact issue when I ported Georgia over to FSM as well, but I don't think most people do otherwise we'd see this kind of complaint a lot more. Most likely it's a combination of media library size, HDD speed, and size of the scripts. @kgena_ua can attempt to work around the problem by executing parts of his script in async promises, which will periodically exit the script execution thread and reset the 10 second timer. That's what I did, and it solves the problem almost all the time except when I'm doing heavy writes/reads on another drive at the same time I startup foobar for the first time. The other solution is for him to remove a significant portion of the code (1-2k lines I'd guess), but that's probably not going to happen.

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

Reply #173
hello MordredKLB + kgena_ua

thank you MordredKLB for your comments.
I agree with you that the size of the music db, the speed of the hdd and the computer are partly responsible for the loading time.
some music lovers will have 20,000 tracks (138 GB) or more. the pcs are 6 years old.

I tested wilb-bio-script today (not a single script error) and compared the start time with that of kgena_ua-script.
it seems (as you also say) that there is still room for improvement.

kind regards

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

Reply #174
I have +70K tracks on my library and loading time is not a problem on my side at all with Wilb script, nor this one, neither with my own which do more expensive calcs at startup than reading text files. So I don't think a large library is the answer but how the thing is coded.

It makes no sense at all that it takes 14 secs at startup when the script is supposed to just show some info from a text file for the current track. No matter how you look at it.

 
SimplePortal 1.0.0 RC1 © 2008-2021