Page 2 of 4

Re: Folder size and Caching

Posted: 23 May 2016 07:13
by Filehero
DmFedorov wrote:Now i can not reproduce this. Excuse me.
No worries. I'm just happy I don't have a major issue here.


Cheers,
Filehero

Re: Folder size and Caching

Posted: 23 May 2016 10:04
by admin
highend wrote:Is this intended?

When I extract a .zip archive with context menu - Zip - Extract here
the cached! folder size view is refreshed (or recalculated?) multiple times during extraction (probably because of having more than one file in the archive).

Auto-refresh is on but
Configuration | Refresh, Icons, History | Auto-Refresh | Refresh during file operations
is off
This is normal. Zip extraction does not count as "file operation" in this context.

The sizes are not recalculated, just read from the cache.

Re: Folder size and Caching

Posted: 23 May 2016 10:59
by admin
LittleBiG wrote:
admin wrote:Fascinating how simple ideas become more and more complex once they get in touch with reality.
Indeed. However, I realized what I wrote sounds complicated. It simply means that "Clear Folder Size Cache" should be a way to be partial. (Clear cached sizes in the current folder and its subfolders).
I'm not sure yet if and what to do about this. Needs more thinking.

Re: Folder size and Caching

Posted: 23 May 2016 10:59
by LittleBiG
LittleBiG wrote:
admin wrote:Fascinating how simple ideas become more and more complex once they get in touch with reality.
Indeed. However, I realized what I wrote sounds complicated. It simply means that "Clear Folder Size Cache" should be a way to be partial. (Clear cached sizes in the current folder and its subfolders).
If this partial clear existed and was added to the scripting somehow like ClearSizeCache($foldername,"recursive"), a very exciting thing could be scripted. Imagine a permanent variable with this content:

Code: Select all

$pv_RefreshCache = "C:\Downloads\,20160523,10|D:\Documents\,20160522,3"
meaning: Folder To Refresh, Last Refresh Date, Frequency
It would be very easy to write a script in the PFA matching all folders. So when you entered a folder, it would check if the folder is in the permanent variable, so it is subjected to regular refresh, and according to the date and frequency, it would run the new ClearSizeCache command on the folder you have just entered. Then would modify the Last Refresh Date to the current.

Sorry for daydreaming but this kind of excitement couldn't be achieved by any other so called file manager.

EDIT:
admin wrote:I'm not sure yet if and what to do about this. Needs more thinking.
Noted. *sigh*

Re: Folder size and Caching

Posted: 23 May 2016 12:39
by admin
ClearSizeCache... hmm, isn't that a bit over the top? I know things that are even more exciting than clearing parts of a cache via scripting... :ninja:

Re: Folder size and Caching

Posted: 23 May 2016 13:30
by admin
LittleBiG wrote:If I decide to use Calculate Folder Sizes to refresh the cache, after refreshing please delete the subfolders from the cache. Otherwise very weird sizes can happen. Think about the situation, when you have the Downloads folders with subfolders Movie, Games, Music and so on, and the next subfolder level like Games/Shooter, Games/Adventure, Movie/Romance, Movie/Comedy and so on. If I have downloaded things, the easiest way to refresh the cache is to recalculate the size of the Downloads folder. If subfolders are not deleted from the cache, I have to find some workaround or I have to visit each subfolder and refresh their size too.
What about this: When calculating a nested folder, all calculated subfolders are written to the cache as well right away.

Advantages:
- Your problem disappears. All subfolders are updated right away.
- Going down into a cached folder will be totally fast, since all subfolders are also already cached.

Disadvantage:
- The cache will be bigger. Maybe much bigger. (But not slower, don't worry. I use binary search here, so it's lightning fast in any size).

Re: Folder size and Caching

Posted: 23 May 2016 13:37
by highend
As long as it's not suffering from it's own size and it's just text entries... I'd vote for storing subfolders as well

Re: Folder size and Caching

Posted: 23 May 2016 13:48
by DmFedorov
admin wrote:When calculating a nested folder, all calculated subfolders are written to the cache as well right away.
I vote for this too.

Re: Folder size and Caching

Posted: 23 May 2016 13:58
by LittleBiG
admin wrote:What about this: When calculating a nested folder, all calculated subfolders are written to the cache as well right away.

Advantages:
- Your problem disappears. All subfolders are updated right away.
- Going down into a cached folder will be totally fast, since all subfolders are also already cached.

Disadvantage:
- The cache will be bigger. Maybe much bigger. (But not slower, don't worry. I use binary search here, so it's lightning fast in any size).
Hehe, you approached it from the other end. I can see only one advantages comparing with partial delete: going down is fast.
Every other aspect is better in case of partial delete:
1. In case of root folder, the whole hard drive will be cached in one go?
2. The cache will be smaller using partial delete, cutting back is good for speed. Your solution means the very opposite.
3. The size of subfolders will be calculated only when I enter the folder. If I don't use a folder for a while, why to cache it in advance?

EDIT: hm I am wondering that if the fsc.dat is a textfile is it possible to create a button which deletes the subfolders from the cache first then starts the size calculation? Or is it too risky to do by myself?

Re: Folder size and Caching

Posted: 23 May 2016 14:09
by LittleBiG
DmFedorov wrote:
admin wrote:When calculating a nested folder, all calculated subfolders are written to the cache as well right away.
I vote for this too.
I vote for the opposite. To cache only what is necessary.

Re: Folder size and Caching

Posted: 23 May 2016 14:37
by admin
LOL. Nothing is easy.

Well, doing a whole drive indeed appears a bit frightening. What about doing just 1 or 2 levels below the top folder that's being calculated?

Re: Folder size and Caching

Posted: 23 May 2016 14:40
by highend
Why not just the first subfolder(s) of the current folder to cache (without any further recursion)?

Re: Folder size and Caching

Posted: 23 May 2016 15:05
by LittleBiG
LittleBiG wrote:Additionally, I wouldn't cache the [Empty] folders. It will be very misleading when some file will be added and the cache still shows empty. It is worse than a not quite exact folder size.
I would like to bring this to your attention with the addition that zero size also shouldn't be cached. I have just unzipped something into a new folder. Its size was cached 0 (because WinZip created the folder first than started to fill with the data), however I unzipped more than a gigabyte into that folder...

Re: Folder size and Caching

Posted: 23 May 2016 15:36
by admin
highend wrote:Why not just the first subfolder(s) of the current folder to cache (without any further recursion)?
Yep, exactly what I will do.

Re: Folder size and Caching

Posted: 23 May 2016 15:36
by admin
LittleBiG wrote:
LittleBiG wrote:Additionally, I wouldn't cache the [Empty] folders. It will be very misleading when some file will be added and the cache still shows empty. It is worse than a not quite exact folder size.
I would like to bring this to your attention with the addition that zero size also shouldn't be cached. I have just unzipped something into a new folder. Its size was cached 0 (because WinZip created the folder first than started to fill with the data), however I unzipped more than a gigabyte into that folder...
Good idea! Done.