EDIT 2012-03-10 : i share a version of the script as it is today here : [link]
>>> feel free to test it (but keep in mind that many things are still to add ...)
The Journal Portal
Browse Journals |
Polls |
deviantART [dee·vee·un'nt·ART]
Keep in Touch!
|
Deviousness |
Started from scratch again and this time it's fast , really fast!
When playlist load/changes i store all the album info (like every album name and tracks id-s, that i use later) to array, it's reasonable fast, on load when there is very large playlist about 50k items it takes 300 ms, but when about 1000 items it's almost instant (and i never use so large playlists anyway).
Then i populate playlist with amount of tracks that are only visible in window, in any given time there is only max 30 items in list. the scrolling is very fast and takes very little resources. I scroll only with mouse and up and down keys for now, the scrollbar comes later.
It develops very slowly but my goal is very optimized and stable result.
So give me few months before the beta
could you tell me how you do that with so efficient time, because when i browse the handlelist to save infos to memory, it takes for me more than 1 or 2 seconds for a 40k list...
Please. Thanx by advance for any tips
var tf_album = fb.TitleFormat("%album%"); // important to stay out of loop (otherwise slows significantly down)
function on_plman(){
var temp_album1;
album = [];
active_playlist = plman.ActivePlaylist;
get_playlist_items = plman.GetPlaylistItems(active_playlist);
playlist_item_count = plman.PlaylistItemCount(active_playlist);
for (var i = 0; i < playlist_item_count; ++i) {
item = get_playlist_items.Item(i);
var temp_album2 = tf_album.EvalWithMetadb(item);
if(temp_album1 != temp_album2){
album.push(temp_album2);
// and here i also push every album first and last tack id to array
}
temp_album1 = temp_album2;
}
}
ok...
let's me know about your progress
have a nice day.
CPU Intel Core 2 Duo E6300, @2800 MHz
Op Microsoft Windows 7 Ultimate x64
foobar2000_v1.1.11
foo_uie_wsh_panel_mod-1.5.2
avarage init times.
51325 items JScript init 350 ms.
JScript9 init 314 ms.
40100 items JScript init 270 ms.
JScript9 init 250 ms.
30100 items JScript init 230 ms.
JScript9 init 185 ms.
20000 items JScript init 155 ms.
JScript9 init 125 ms.
10000 items JScript init 70 ms.
JScript9 init 58 ms.
5000 items JScript init 30 ms.
JScript9 init 35 ms.
1000 items JScript init 6 ms.
JScript9 init 6 ms.
1000 items JScript init 6 ms.
JScript9 init 6 ms.
500 items JScript init 3 ms.
JScript9 init 3 ms.
100 items JScript init 0 ms.
JScript9 init 0-1 ms.
and have a nice day too
i've just found a way to optimize the function that read the whole playlist to find group hearder breaks. on a 41k playlist, i won 100 ms with my new function, and 100ms it's always good to take
old loop takes 270 ms
new loop takes 170 ms
same result!
>> if you're interested, tell me, i'll explain to you how to do with the code before and after of this function
thanx, i've investigate and i've found a way to use this methods to store all the album breaks. That has simplified my code, so thanx to you, delay is acceptable, except on item remove in the playlist where i call this storage function because album breaks may have change due to this item delete ...
performances are really good for now and my panel is near to do all what a playlist viewer have to, so im' really pleased
the only thing i think i'll not try to do is group collapsing/expanding ... but who now, maybe later if all is perfect.
some progress on your side ?
i've started from scratch too, for the engine that construct the part of the list visible on the panel (with the group headers)
the most difficult part with my methods is to handle the scrollbar cursor at the good position when i scroll, especially when it's clos to the boundaries. but it seems i've do it and then engine seems robust and reliable now. i've added covers (same code as my previous version because it was ok), incremental search, ...
now, i've to code the top toolbar which must allow to choose columns to display in the track row and in which order, size ..., a big part
i hope we'll be able to share our work soon
keep the good work!
here is a new screenshot from mine, as you can see, i've to work on columns infos to display, for now i just simply draw tracknumber and title
(the text in the middle is what you see when you use Incremental Search feature, it's more visuel, and disappear after a second when your stop typing)
[link]
bye