Re: Perl and a Ramdisk
- From: Bill H <bill@xxxxxxxxx>
- Date: Fri, 30 Nov 2007 11:45:16 -0800 (PST)
On Nov 30, 1:12 pm, smallpond <smallp...@xxxxxxxx> wrote:
On Nov 30, 12:46 pm, Bill H <b...@xxxxxxxxx> wrote:
I am working on a chat program and am thinking of using a ramdisk to
hold the chat data. Is there anything special I should know about
accessing ramdisk from perl or is it just another disk to perl? On my
development machine I don't have a ramdisk, so I will be using the HD
for storing while debuging, but on the machine it will run on there is
one, and it would be nice if I could just have a variable holding the
destination and only have to change that instead of changing any
routines that did any file i/o.
Bill H
"Premature optimization is the root of all evil."
-- C. A. R. Hoare
Your plan is good right up to the part where you actually
switch over to using the ramdisk. Every modern OS already
has excellent code to do secure and reliable caching of disk
data. I would see if the disk access is actually a problem
before changing, which should be just the filename that you
open or a symbolic link.
If you do create a ramdisk, you will need to create a
filesystem in it, unless you plan on using the raw disk.
You will also have to preload it and worry about saving
it on shutdown if it will contain any permanent data.
--S
I am not concerned about loosing the data with shutdown, since it is
chat the data is transient, only need what someone types for a few
seconds to echo it to the other chatters. I am more concerned with
speed and less disk accesses. I figure it will be a whole lot faster
open a file, reading, writing, closing files in a ramdisk than in on a
HD.
Bill H
.
- References:
- Perl and a Ramdisk
- From: Bill H
- Re: Perl and a Ramdisk
- From: smallpond
- Perl and a Ramdisk
- Prev by Date: Re: East european characters from LaTex to UTF8
- Next by Date: Re: OT raibow
- Previous by thread: Re: Perl and a Ramdisk
- Next by thread: FAQ 3.29 When I tried to run my script, I got this message. What does it mean?
- Index(es):
Relevant Pages
|