Cache Length Column [Asynchronous (non-blocking) List Columns]

Features wanted...
Post Reply
Evolve
Posts: 353
Joined: 27 Feb 2020 09:48

Cache Length Column [Asynchronous (non-blocking) List Columns]

Post by Evolve »

The List can load most of the standard columns very fast.
But some columns are just slow: Folder Size, Length, Hash.
Fortunately we have cache for the folder sizes which is great, but not for the other ones.
We also have custom columns with infinite possibilities that can easily be as slow.
1EAoNu6d7i.gif
1EAoNu6d7i.gif (86.77 KiB) Viewed 1330 times
Is it possible to make the List show the slow Columns instantly (with empty placeholders) and fill the data asynchronously when it's ready instead of blocking the UI and breaking the experience while waiting for ALL the data before showing anything?
jexcTggQqu.gif
jexcTggQqu.gif (260.01 KiB) Viewed 1330 times
Last edited by Evolve on 20 Aug 2022 11:18, edited 1 time in total.

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Asynchronous (non-blocking) List Columns

Post by admin »

Let me put it this way: no. :)

Evolve
Posts: 353
Joined: 27 Feb 2020 09:48

Re: Asynchronous (non-blocking) List Columns

Post by Evolve »

My biggest concern here is the Length column. I know I already asked you about caching it and you said it wasn't planned. But unlike some edge cases (hash, exotic custom columns), the Length column is commonly used by many users and I hope you'll reconsider caching it some day.
-----------------------------------------------------------------------------
It's a shame that one of the most useful columns can only be used (painfully) with idle HDD. Once I put HDD under any load, the tabs with the Length column become completely unswitchable. It's not only blocking the tab while trying to reread all the Lengths, if I start clicking somewhere, I get partial rendering which feels even more broken.
nwlCoXztwd.gif
nwlCoXztwd.gif (74.76 KiB) Viewed 1283 times

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Cache Length Column [Asynchronous (non-blocking) List Columns]

Post by admin »

Looks extreme. It's far faster here. Maybe you need a better shell extension for retrieving those properties.

Evolve
Posts: 353
Joined: 27 Feb 2020 09:48

Re: Cache Length Column [Asynchronous (non-blocking) List Columns]

Post by Evolve »

admin wrote: 20 Aug 2022 12:30 Looks extreme. It's far faster here.
It's much faster here too with an idle HDD (still not smooth enough though).
But as soon as I put some work on it (copying smth) it degrades significantly.
admin wrote: 20 Aug 2022 12:30 Maybe you need a better shell extension for retrieving those properties.
The one that will grab them from cache instead of extracting again and again especially when HDD is occupied by some other work. :)

Norn
Posts: 416
Joined: 24 Oct 2021 16:10

Re: Cache Length Column [Asynchronous (non-blocking) List Columns]

Post by Norn »

I've tagged a lot of items, and when I showed the tags column and the label column, it took two or three seconds to open a folder, the Label column was unnecessary for me, so I turned it off and the problem was solved...
Win10, Win11 @100% 2560x1440 22H2

Evolve
Posts: 353
Joined: 27 Feb 2020 09:48

Re: Cache Length Column [Asynchronous (non-blocking) List Columns]

Post by Evolve »

I'm not that familiar with tags as I probably should be. I only use stars for ratings currently. So I'm a bit confused with you juggle back and forth speaking of labels and tags. Do I understand correctly that your solution for a slow column is to just hide it and never use it again?

All I know about tags related to the subject is that at least tags are stored inside tag.dat which is in XY folder which is in a RAM disk here. I'd be super happy to have those slow properties/columns like Length cached and stored inside XY folder somewhere...

PS. Forget about me and my RAM disk, I already can hear @admin telling me "no one else uses it except you..." :D
For the users with XY on their SSDs (which is almost everyone at this point, I believe) this would be as beneficial compare to extracting video lengths from a slow HDD every single time when the same HDD is also trying to do something else in parallel. Maybe I'm wrong, but I think most of the people still make use of their HDDs for storing such a heavy content as video.

Norn
Posts: 416
Joined: 24 Oct 2021 16:10

Re: Cache Length Column [Asynchronous (non-blocking) List Columns]

Post by Norn »

No, I'm just giving feedback on my situation, loading columns may need improvement.
Win10, Win11 @100% 2560x1440 22H2

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Cache Length Column [Asynchronous (non-blocking) List Columns]

Post by admin »

Norn wrote: 20 Aug 2022 16:54 I've tagged a lot of items, and when I showed the tags column and the label column, it took two or three seconds to open a folder, the Label column was unnecessary for me, so I turned it off and the problem was solved...
Sounds weird. The Label column should be faster than the Tags column. Unless the painting is slow for some reason.

Evolve
Posts: 353
Joined: 27 Feb 2020 09:48

Re: Cache Length Column [Asynchronous (non-blocking) List Columns]

Post by Evolve »

It turns out that it is incredibly easy to create a cached custom column by using tags.

Code: Select all

$length_tag = tagitems("ex16", , "<cc_item>");
	$modified = filetime("<cc_item>");
	if ($length_tag == "" or $modified != tagitems("ex15", , "<cc_item>")){
		$length = property("System.Media.Duration", <cc_item>) \ 10000000;
		$hours = $length \ 3600;
		$minutes = $length % 3600 \ 60;
		$seconds = $length % 3600 % 60;
		$length_tag = format($hours, "00") . ":" . format($minutes, "00") . ":" . format($seconds, "00");
		tagitems("ex16", $length_tag, "<cc_item>");
		tagitems("ex15", $modified, "<cc_item>");
	}
	return $length_tag;
All I need now is to be able to use ex16 the custom column as a source for the status bar template.

Code: Select all

v22.50.0217 - 2021-12-05 20:16
    + SC get("LengthsSelected") enhanced. Added some more flags.
      Syntax: get("LengthsSelected", [pane=a], [flags])
        flags: (bit field)
          1 = Show milliseconds.
          2 = Return value only if the Length column is visible (i.e. if it can 
              be pulled from that column).
          4 = Use the shell property "Length" (otherwise use XY's native and 
              more exact special property "audio.length").
      Examples:
        text <get LengthsSelected a 3>;  //show msecs, pull from special property column
        text <get LengthsSelected a 6>;  //no msecs, pull shell property from column
@admin May I ask you to enhance it one more time?

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Cache Length Column [Asynchronous (non-blocking) List Columns]

Post by admin »

Needs more thinking. Maybe later.

Evolve
Posts: 353
Joined: 27 Feb 2020 09:48

Re: Cache Length Column [Asynchronous (non-blocking) List Columns]

Post by Evolve »

Evolve wrote: 04 Sep 2022 10:00 to be able to use the custom column as a source
If this is too broad, restrict it to just ex1-ex16 and one must keep them in nanoseconds.

Code: Select all

Syntax: get("LengthsSelected", [pane=a], [flags], [source=Special])
  flags: (bit field)
    1 = Show milliseconds.
    2 = Return value only if the source column is visible (i.e. if it can 
        be pulled from that column).	  
  source:
    Special: use XY's native and more exact special property "audio.length"
    Shell: use the shell property "Length"
    Ex1-Ex16: use the extra column/tag (must be in nanoseconds)
Examples:
  text <get LengthsSelected a 3>;  //show msecs, pull from special property column
  text <get LengthsSelected a 2 shell>;  //no msecs, pull shell property from column
  text <get LengthsSelected a 1 ex16>; //show msecs, pull from ex16 tag
  text <get LengthsSelected a 2 ex1>; //no msecs, pull from ex1 column

Evolve
Posts: 353
Joined: 27 Feb 2020 09:48

Re: Cache Length Column [Asynchronous (non-blocking) List Columns]

Post by Evolve »

Evolve wrote: 06 Sep 2022 10:52 If this is too broad....
On the other hand, if it's not broad enough, the opposite direction would be to generalize it.

Code: Select all

get("ReducedSelected", [func=count], [column=Name])
	func:
		count
		sum
		max
		min
		avg
Note: the current column format will be used.
Note: if multiple columns share the same name, the leftmost one will be used.

Examples:
	<get ReducedSelected sum Length 'time: *'>  // time: 05:10:44
	<get ReducedSelected max Modified 'latest: *'> // latest: 01/05/2022
	<get ReducedSelected min Size 'smallest: *'> // smallest: 3,32 GB
	<get ReducedSelected avg Rating 'average: *'>// average: 4
reduce.png
reduce.png (9.58 KiB) Viewed 952 times

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Cache Length Column [Asynchronous (non-blocking) List Columns]

Post by admin »

Nice. When I find the time...

Post Reply