DriverHeaven.net

Looking for the skin chooser?
 
 
  • Home

  • Reviews

  • Articles

  • News

  • Tools

  • GamingHeaven

  • Forums

  • Network

 

Go Back   DriverHeaven.net > Forums > Software / Tools > Windows 7 Forum


Reply
 
LinkBack Thread Tools
Old Jun 15, 2009, 11:04 PM   #1
mkk
cheap philanthropist
 
mkk's Avatar
 
Join Date: Oct 2003
Location: Gefle, Sweden
Posts: 3,682
Rep Power: 67
mkk has a divinity and aura the likes we have never seenmkk has a divinity and aura the likes we have never seenmkk has a divinity and aura the likes we have never seenmkk has a divinity and aura the likes we have never seenmkk has a divinity and aura the likes we have never seenmkk has a divinity and aura the likes we have never seenmkk has a divinity and aura the likes we have never seenmkk has a divinity and aura the likes we have never seenmkk has a divinity and aura the likes we have never seenmkk has a divinity and aura the likes we have never seenmkk has a divinity and aura the likes we have never seen
System Specs

A little project: bringing back some cache.

I got an idea and got carried away so instead of sleeping I put a little something together. A batch file that in a fairly efficient way reads files and folders location data off the drives, forcing the file cache to store it. This is probably not for all systems but for what little I've tested yet I can't see why I won't keep this unless prefetching in Windows 7 gets changed in the last minute. Anyway here's the readme I've been typing on, hopefully without too many errors.

I'm looking for critique of both the idea and the method and I want you to find flaws in the system. Not with proofreading the text though because I'll work more on it when my head has cleared. I'm sure something is not very clearly described though, and I changed some methods half way through so I had to rework the readme a few times, lol. I'm off to bed.

file: http://www.ghus11.to/mikael.karlsson...ryout_file.zip

Edit: Minor changes, remade the delay system in standard batch job to just one big 30s deyal, and added optional batch without any delay.

Quote:
readme.txt
Premise: File caching is a great performance booster and today RAM is inexpensive.
Not so amused was I then to notice how with Windows 7 the prefetching of
file data into the cache had gotten heavily toned down. In an attempt to
somewhat improve the situation through simple means I thought of the idea
that "wouldn't it be nice if the system at least knew the location of all
files right after startup?". This might seem so simple that one could
assume it to already be the case, but it's not or at least not cache-wise.
This simple routine forces the system to go over the location of every file
in the system (some configuration may be necessary) and take note of it
in the filecache.

Benefit: When writing this I have not been using this method for more very long.
But apart from having a snappier system when going over folders with lots
of files and subfolders, I was surprised to find that even some programs
that are put together of many small files(Photoshop) start up a bit faster
the first time. Almost like it used to be with the prefetching from Vista.

Files: This package which you've presumably already unzipped contains two files.
readme.txt <- This very document.
dir all drives.cmd <- The batch workfile that you run.
dad - nodelay.cmd <- Same work but without 30s initial delay.

HowTo: The easiest way to do this and my default suggestion is to put these files
files anywhere on your system where they will be out of the way, then make
a shortcut to the "dir all drives.cmd" file in the Start Menu folder named
Startup, the one where other programs that start automatically with Windows.
The batch file will wait 30 seconds by default in order to give the system
enough time to start up the desktop and other software set to run whenever
the user(you) logs on. Then the batch simply tells the system to list every
file on its drives, by default going over drives C, D, E, F and G. In case
you have even more drives or would want some drive not to be touched for
whatever reason, right-click on the file "dir all drives.cmd" and choose
Edit. Batch files like this one are really plain text files with basic
Windows command line commands being carried out in a certain order. To add
or remove drives, copy/paste or delete lines that contain the "dir"
command, replacing the drive letters as necessary.

Option: If you only want to run this manually you can do so by simply executing
the batch workfile any way you like. The 30 seconds delay still apply unless
like above with the drives you edit the batch file and remove or add delays.
NEW: You can also use the file "dad - nodelay.cmd" that has no delay in it.
Another way is if you are handy with Windows own Task Scheduler then you can
use this batch file alone, with all sorts of starting conditions as
specified in the scheduled task you create for it. Google up some guide.

Note: After the job has been carried out the information that the system gathers
into the file cache should remain there until the system runs out of unused
memory and needs more for something else. That should normally take a long
time on a modern system with a decent amount of RAM since this information
does not take a lot of space. A way to verify that the data is still in the
cache is to run this job again, as it will complete almost instantaneously
as it reads straight from the cache if the data remains. A reason for that
speed is that there is no listing information put up on the screen here.
Otherwise it would take a moment even to list the data straight from RAM.

Ping?: Yes, I use a ping command to the typically invalid iPv4 1.3.2.4 in order to
create timed delays when useful. This might look odd in some log but should
cause no discomfort for your system and nothing really leaves the system.

Caution: It's probably best not to use this method on laptops that run off battery
power alone, or systems that are low on RAM. I intended this primarily for
Windows 7 and a decent amount of RAM would be 2GB, the more the better.
With much less than 2GB of RAM this method might be of little use.

Secure: I'm glad to be able to write that the resulting file listings are not stored
anywhere except in the the file cache. They don't even show on screen.
Quote:
dir all drives.cmd
@echo off
echo Waits for 30s then reads the file structure on all specified drives.
echo.
echo Default drives are C: through G:.
echo.
echo Waiting lets most systems start up their stuff before this job proceeds.
echo.
echo After this job is done this command window will quit automatically.
echo.
echo The operation is silent, ie no resulting text will fill the screen.
echo.
echo This makes the operation much faster than otherwise.
echo.
echo See "readme.txt" for more information.
ping 1.3.2.4 -n 1 -w 30000 >nul
dir c: /l /s /w >nul
echo drive c: done
dir d: /l /s /w >nul
echo drive d: done
dir e: /l /s /w >nul
echo drive e: done
dir f: /l /s /w >nul
echo drive f: done
dir g: /l /s /w >nul
echo drive g: done
exit
Quote:
dad - nodelay.cmd (optional)
@echo off
dir c: /l /s /w >nul
echo drive c: done
dir d: /l /s /w >nul
echo drive d: done
dir e: /l /s /w >nul
echo drive e: done
dir f: /l /s /w >nul
echo drive f: done
dir g: /l /s /w >nul
echo drive g: done
exit

Last edited by mkk; Jun 16, 2009 at 04:02 PM.
mkk is offline   Reply With Quote


Old Jun 15, 2009, 11:22 PM   #2
DriverHeaven Newbie
 
Join Date: Jun 2009
Posts: 1
Rep Power: 0
taurus25661 is on a distinguished road

Re: A little project: bringing back some cache.

Hmm...
taurus25661 is offline   Reply With Quote
Old Jun 16, 2009, 07:13 AM   #3
DriverHeaven Extreme Member
 
Mac Daddy's Avatar
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 7,950
Rep Power: 64
Mac Daddy is just really niceMac Daddy is just really niceMac Daddy is just really niceMac Daddy is just really niceMac Daddy is just really nice
System Specs

Re: A little project: bringing back some cache.

Interesting mkk I will give it a more thorough read through after work
__________________
"My mom said the only reason men are alive is for lawn care and vehicle maintenance." - Tim Allen
Mac Daddy is offline   Reply With Quote
Old Jun 16, 2009, 04:01 PM   #4
mkk
cheap philanthropist
 
mkk's Avatar
 
Join Date: Oct 2003
Location: Gefle, Sweden
Posts: 3,682
Rep Power: 67
mkk has a divinity and aura the likes we have never seenmkk has a divinity and aura the likes we have never seenmkk has a divinity and aura the likes we have never seenmkk has a divinity and aura the likes we have never seenmkk has a divinity and aura the likes we have never seenmkk has a divinity and aura the likes we have never seenmkk has a divinity and aura the likes we have never seenmkk has a divinity and aura the likes we have never seenmkk has a divinity and aura the likes we have never seenmkk has a divinity and aura the likes we have never seenmkk has a divinity and aura the likes we have never seen
System Specs

Re: A little project: bringing back some cache.

Quote:
Originally Posted by taurus25661 View Post
Hmm...
Welcome to the forum, lol. I would enjoy your scepticism in a few more words.
mkk is offline   Reply With Quote
Old Jun 16, 2009, 09:30 PM   #5
DriverHeaven Extreme Member
 
Mac Daddy's Avatar
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 7,950
Rep Power: 64
Mac Daddy is just really niceMac Daddy is just really niceMac Daddy is just really niceMac Daddy is just really niceMac Daddy is just really nice
System Specs

Re: A little project: bringing back some cache.

Quote:
Originally Posted by mkk View Post
Welcome to the forum, lol. I would enjoy your scepticism in a few more words.
My thoughts as well good stuff and might play with it on the weekend
__________________
"My mom said the only reason men are alive is for lawn care and vehicle maintenance." - Tim Allen
Mac Daddy is offline   Reply With Quote
Old Jun 16, 2009, 09:59 PM   #6
...just bummin 'round
 
[hobo]eclipse's Avatar
 
Join Date: Oct 2004
Posts: 2,555
Rep Power: 49
[hobo]eclipse has much to be proud of[hobo]eclipse has much to be proud of[hobo]eclipse has much to be proud of[hobo]eclipse has much to be proud of[hobo]eclipse has much to be proud of[hobo]eclipse has much to be proud of[hobo]eclipse has much to be proud of[hobo]eclipse has much to be proud of[hobo]eclipse has much to be proud of[hobo]eclipse has much to be proud of
System Specs

Re: A little project: bringing back some cache.

im always up for some tweaking, and just the other day installed win7 7229 x64, but before i dive in i d like to know a little more about. currently my pc has been on for 1 day and 5 hours. the free mem in task manager is hanging out at bout 5, +\-2 MB or so, cached 2845, avail 2823 with a total of 4094. 1.24 GB showing on the meter. obviosly superfetch has used my reaming available mem as cache.

is this tweak more about what gets cached rather than how much is cached?
__________________

seeing the same things over again, repeating the same slogans we don't know where we've been
[hobo]eclipse is online now   Reply With Quote
Old Jun 16, 2009, 10:29 PM   #7
mkk
cheap philanthropist
 
mkk's Avatar
 
Join Date: Oct 2003
Location: Gefle, Sweden
Posts: 3,682
Rep Power: 67
mkk has a divinity and aura the likes we have never seenmkk has a divinity and aura the likes we have never seenmkk has a divinity and aura the likes we have never seenmkk has a divinity and aura the likes we have never seenmkk has a divinity and aura the likes we have never seenmkk has a divinity and aura the likes we have never seenmkk has a divinity and aura the likes we have never seenmkk has a divinity and aura the likes we have never seenmkk has a divinity and aura the likes we have never seenmkk has a divinity and aura the likes we have never seenmkk has a divinity and aura the likes we have never seen
System Specs

Re: A little project: bringing back some cache.

After having been run for such a long time the cache should fill up naturally with whatever files you have been using, for instance every web page or picture loaded is left in the growing filecache without any action from Superfetch. Superfetch is more about keeping track of files that are used often, and then preloading the cache with those files before the user touches them or starts a program that uses them.
Typically when I was running Vista, Superfetch was preloading several gigabytes of data into unused(free) RAM right after startup. Here so far with Windows 7 (or at least after the open beta) it doesn't do much until 5-6 minutes after startup and then preloads maybe 3-400MB of data and then stops, seemingly not picking up again. That's my experience anyhow. But I won't go back to Vista over it.

Now what this batchfile does in a nushell is making the system go over the drives contents and load the folder structure and location of all files into the cache so that it has that information readily available when a program or the user accesses files and folders. It does not make the system preload the actual contents of any files, just the structure of where all the stuff is. Searching for files for instance or entering a folder with a lot of files like for instance "c:\windows\system32\" is speeded up since all of the folder structure and file locations already resides in RAM. Even starting a program like Photoshop that consists of many small files is sped up noticeably, which surprised me but with so many files involved it appears to have been help enough to just preload the structural data.

This method could also benefit systems running WinXP or Vista with Superfetch disabled (as quite a few people to do) but I'm concentrating on testing this out with Windows 7 for now.

Edit: Another benefit for my own system is related to how I have six harddrives most of which fall asleep after just ten minutes by choice. Now since all their file structure already exists in RAM through the cache, I can browse the folders on the sleeping drives without having to wait for a drive to wake up just to read the root folders. With Vista Superfetch was preloading so much that this was typically the case anyway, but now for me it helps here also to give the cache a kick in the right direction.

Last edited by mkk; Jun 16, 2009 at 10:38 PM.
mkk is offline   Reply With Quote
Old Jun 17, 2009, 12:12 PM   #8
DriverHeaven Lover
 
jandarsun8's Avatar
 
Join Date: Jan 2008
Location: US
Posts: 173
Rep Power: 18
jandarsun8 is just super!jandarsun8 is just super!jandarsun8 is just super!jandarsun8 is just super!jandarsun8 is just super!jandarsun8 is just super!
System Specs

Re: A little project: bringing back some cache.

I understand what your doing here but I'm at work at can't test this. If say, I have a home server and I have drives mapped to it, like my S:\ drive or my Documents folder mapped to the server instead would it cache those as well for faster browsing? Just curious with this being a file directory cache and not a program cache.
__________________
jandarsun8 is offline   Reply With Quote
Old Jun 17, 2009, 01:19 PM   #9
DH's Dormant Dragon
 
Judas's Avatar
 
Join Date: May 2002
Location: IN Rem-Dormancy
Posts: 28,338
Rep Power: 125
Judas has a divinity and aura the likes we have never seenJudas has a divinity and aura the likes we have never seenJudas has a divinity and aura the likes we have never seenJudas has a divinity and aura the likes we have never seenJudas has a divinity and aura the likes we have never seenJudas has a divinity and aura the likes we have never seenJudas has a divinity and aura the likes we have never seenJudas has a divinity and aura the likes we have never seenJudas has a divinity and aura the likes we have never seenJudas has a divinity and aura the likes we have never seenJudas has a divinity and aura the likes we have never seen
System Specs

Re: A little project: bringing back some cache.

this looks extremely interesting.....
__________________
Quote:
I accidently my Reputation
Judas is offline   Reply With Quote
Old Jun 17, 2009, 03:02 PM   #10
mkk
cheap philanthropist
 
mkk's Avatar
 
Join Date: Oct 2003
Location: Gefle, Sweden
Posts: 3,682
Rep Power: 67
mkk has a divinity and aura the likes we have never seenmkk has a divinity and aura the likes we have never seenmkk has a divinity and aura the likes we have never seenmkk has a divinity and aura the likes we have never seenmkk has a divinity and aura the likes we have never seenmkk has a divinity and aura the likes we have never seenmkk has a divinity and aura the likes we have never seenmkk has a divinity and aura the likes we have never seenmkk has a divinity and aura the likes we have never seenmkk has a divinity and aura the likes we have never seenmkk has a divinity and aura the likes we have never seen
System Specs

Thumbs Up! Re: A little project: bringing back some cache.

Quote:
Originally Posted by jandarsun8 View Post
If say, I have a home server and I have drives mapped to it, like my S:\ drive or my Documents folder mapped to the server instead would it cache those as well for faster browsing? Just curious with this being a file directory cache and not a program cache.
An excellent question, I hadn't pondered that aspect before and could set up a simple network to run some tests, but not too soon though (big holiday coming up here in Sweden).

There must be a client side limitation here when it comes to network drives since there is no probably way for the client system to know when files and folders have changed on the server until it makes the query. I'm not experienced enough with networks to make an educated guess, but I assume there should be some sort of time interval for a client to request a full re-read of the folder structure on a server. On a high speed local network such a time interval could be kept very low, which wouldn't help us in this case. (On the other hand I wonder if at this day and age there aren't some servers that can act differently by pushing this new information onto clients.)

Fortunately however, assuming that the server is not overworked it will keep the file and folder structure in its own RAM cache. If it doesn't already before the client runs this batch job, then it certainly will have the data in cache and the next request for folder and file structure information will be sent from the RAM cache on the server, and so at least faster than if the data had to be gathered straight from a server harddrive.

Excellent questions people, it really helps to evaluate the usefulness of this idea

Last edited by mkk; Jun 17, 2009 at 03:07 PM.
mkk is offline   Reply With Quote
Old Jun 17, 2009, 04:58 PM   #11
DH's Dormant Dragon
 
Judas's Avatar
 
Join Date: May 2002
Location: IN Rem-Dormancy
Posts: 28,338
Rep Power: 125
Judas has a divinity and aura the likes we have never seenJudas has a divinity and aura the likes we have never seenJudas has a divinity and aura the likes we have never seenJudas has a divinity and aura the likes we have never seenJudas has a divinity and aura the likes we have never seenJudas has a divinity and aura the likes we have never seenJudas has a divinity and aura the likes we have never seenJudas has a divinity and aura the likes we have never seenJudas has a divinity and aura the likes we have never seenJudas has a divinity and aura the likes we have never seenJudas has a divinity and aura the likes we have never seen
System Specs

Re: A little project: bringing back some cache.

a new system that would allow another computer to access the cached information on a networked computer about it's own file systems would probably be the best right?

but i haven't a clue how that would work...

Instead of caching all the information onto the very computer accessing the networked drives... as the other machine could make changes... append those changes to it's own cache at which point the other machine would have to completely refresh the cache as well...

complicated lol
__________________
Quote:
I accidently my Reputation
Judas is offline   Reply With Quote
Reply

Bookmarks

Thread Tools