Re: First slow, then fast
Re: First slow, then fast
- Subject: Re: First slow, then fast
- From: publiclook <email@hidden>
- Date: Sun, 3 Aug 2003 22:48:46 -0400
To clear up a possible miscommunication:
Cache is a general term that means to keep frequently used or valuable
things in a handy or secure place. A squirrel has a cache of nuts. A
pirate has a cache of treasure. A musician has a cache of memorized
music. A diplomat has a cache of prestige. A movie start has a cache
of glamor. A computer chip has a cache of data and a cache of
instructions, and in this case, an operating system has a cache of
recently accessed file system information called a file system cache.
Unix systems often use all memory that is not otherwise being used to
store a cache of recently or frequently accessed disk information.
Modern disk drives also have a disk cache (RAM) on board. The first
time a search runs, many parts of the disk are accessed and the
information is stored in RAM just in case you want it again soon. The
second time you search, there is not reason to check the disk at all in
many cases because the requested information id already in the
operating system's file system cache.
On Sunday, August 3, 2003, at 09:59 PM, Matt Gemmell wrote:
On 4/8/03 at 1:51 am, Lorenzo said:
Do you really think the system puts the data into the cache? IF so,
how does my app knows that the data it needs at the second search are
the same data contained in the cache?
The app doesn't know; the system makes that determination.
Or did you mean the function is in the cache?
If I understand what you mean, then yes, you could say that - the
system
knows if you've performed this same "search" recently, and can then
check to see if already has a list of suitable "results". It's
significantly more complicated than that in practice, of course.
And up above, is a way to make the first search as fast as the next
searches?
If it's a standard search, then perhaps perform it in a thread as soon
as your app starts up? If there's some variation in the nature of the
query, you could try performing a more general query at launch which is
likely to include all results required by any specific searches the
user
initiates later.
Or try looking into using AIAT, or wrap the command-line "find" tool,
and/or rethink the requirements of your searches.
Cheers,
-Matt
--
Matt Gemmell
Irate Scotsman
http://www.scotlandsoftware.com/blog/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.