Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
everything is in RAM, but it's not fast, why??
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
punter
Guru
Guru


Joined: 25 Nov 2002
Posts: 506

PostPosted: Sun May 14, 2006 1:43 pm    Post subject: everything is in RAM, but it's not fast, why?? Reply with quote

i have a small directory, which i write to and read from very very often.
basically, it's a latex document... i write with vim, compile with latex, and reload with evince to get near real-time view of my document...

i transfered my directory to /tmp (mounted on tmpfs) to speedup the write/compile/read process, but i don't notice any performance improvements !!

the way i see it:
1. files are on tmpfs (RAM)
2. the evince is loaded already (in RAM), and i just reload the page (read from tmpfs/RAM)
3. vim is loaded into RAM, and its write operations just write into tmpfs (on RAM)
4. latex is loaded and unloaded for each write/compile, so its read from disk (or possibly the cache if the system is smart enough)....

can someone tell me why should the above configuration not result in almost an instantanous process???
how can i have latex always loaded (in RAM) as well ?
Back to top
View user's profile Send private message
SoylentGreen
l33t
l33t


Joined: 19 Aug 2005
Posts: 904
Location: The Hostel

PostPosted: Sun May 14, 2006 1:48 pm    Post subject: Reply with quote

well, you still have to "compile with latex" (as you post) so this is about the CPU then. sure, discaccess is an issue (if you have very old disks), but most time is consumed by the compile process. faster cpu - faster speed.
Back to top
View user's profile Send private message
didymos
Advocate
Advocate


Joined: 10 Oct 2005
Posts: 4798
Location: California

PostPosted: Sun May 14, 2006 1:52 pm    Post subject: Reply with quote

Well, the thing is, tmpfs isn't necessarily in RAM all the time. It can be swapped. It goes the VM filesystem, which means it's up to the kernel as to whether or not it's pages are in physical RAM not.
_________________
Thomas S. Howard
Back to top
View user's profile Send private message
SoylentGreen
l33t
l33t


Joined: 19 Aug 2005
Posts: 904
Location: The Hostel

PostPosted: Sun May 14, 2006 2:02 pm    Post subject: Reply with quote

didymos wrote:
Well, the thing is, tmpfs isn't necessarily in RAM all the time. It can be swapped. It goes the VM filesystem, which means it's up to the kernel as to whether or not it's pages are in physical RAM not.

duh! sure you are right, didnt realize the tmpfs at all :oops:
however, you could actually have /tmp in ramfs.

though, i do not think it will improve speed that much anyway for his latex compile
Back to top
View user's profile Send private message
punter
Guru
Guru


Joined: 25 Nov 2002
Posts: 506

PostPosted: Sun May 14, 2006 2:09 pm    Post subject: Reply with quote

you've got to be joking, all my life i wondered what plausible excuse can i have for getting a new computer and playing new games on it ......
now you tell me the answer is as simple as the annoyance of latex compiling my 8 page document ?!!

ok, can i just change tmpfs to ramfs in /etc/fstab to mount it as ramfs, or do i need to find myself a guide or something?

incidently, does any quick tips come to mind regarding faster performance of latex program??
i'm rather annoyed to be even asking this question on a 4 months old laptop, with intel pentium 3-m 1.73GHz processor on it.
Back to top
View user's profile Send private message
SoylentGreen
l33t
l33t


Joined: 19 Aug 2005
Posts: 904
Location: The Hostel

PostPosted: Sun May 14, 2006 2:24 pm    Post subject: Reply with quote

well, first of all i wouldnt put your document to /tmp, just for security reasons. you could mount any other directory to ramfs, that is a better idea. search the forums for ramfs, plenty talk about this, easy to setup.

though.. you have a pretty new machine, and i guess your HDD is at least UDMA100, so that wouldnt help much. if everything else is compiling pretty fast, i would blame it on latex?
Back to top
View user's profile Send private message
punter
Guru
Guru


Joined: 25 Nov 2002
Posts: 506

PostPosted: Sun May 14, 2006 2:26 pm    Post subject: Reply with quote

SoylentGreen, you were right.
i did some read/write time analysis and the speed of both is almost negligible to the processing time of latex.

i do however have some good results:
i managed to speedup the process from 2.7 sec to 0.24 sec (more than 10x faster).

here's the howto:
1. "latex paper.tex" took 1.3 secs --->>> but "latex paper.tex >& /dev/null" took 0.22
2. "dvipdf paper.dvi" took 1.4 secs regardless of what i'd do --->>> so i ignored it, i use xdvi instead of evince

amazing how little things can make such differences.....

thanks alot for the suggestions.


Last edited by punter on Sun May 14, 2006 2:27 pm; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54845
Location: 56N 3W

PostPosted: Sun May 14, 2006 2:27 pm    Post subject: Reply with quote

punter,

It won't make any differnce, everything you use frequently is in RAM anyway because the kernel uses any left over RAM for buffers.
This means that things are only fetched from disc once, provided the buffer space is not needed to run an application.

Does your system normally swap?
If so, treat it to a RAM upgrade.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
punter
Guru
Guru


Joined: 25 Nov 2002
Posts: 506

PostPosted: Sun May 14, 2006 2:39 pm    Post subject: Reply with quote

NeddySeagoon, i don't know what's the caching and syncing policies on my kernel...
but if you perform a write operation from a program (e.g. vim) and read by another (e.g. latex) on the same file.

ideally, you'd like the kernel to keep the file in the buffer space and link both read and write operations to the same file, and later flush it to the disk....

what i feel actualy happens is that the kernel flushes the dirty write to the disk before performing the read operation.
i say this because my first "latex paper.tex" processes after write operations are the longest...
is there any sure way to check this out?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum