View previous topic :: View next topic |
Author |
Message |
punter Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
Joined: 25 Nov 2002 Posts: 506
|
Posted: Sun May 14, 2006 1:43 pm Post subject: everything is in RAM, but it's not fast, why?? |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
SoylentGreen l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/19872352734460b326d699c.png)
Joined: 19 Aug 2005 Posts: 904 Location: The Hostel
|
Posted: Sun May 14, 2006 1:48 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
didymos Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/1790706086435438446060f.jpg)
Joined: 10 Oct 2005 Posts: 4798 Location: California
|
Posted: Sun May 14, 2006 1:52 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
SoylentGreen l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/19872352734460b326d699c.png)
Joined: 19 Aug 2005 Posts: 904 Location: The Hostel
|
Posted: Sun May 14, 2006 2:02 pm Post subject: |
|
|
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
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 |
|
![](templates/gentoo/images/spacer.gif) |
punter Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
Joined: 25 Nov 2002 Posts: 506
|
Posted: Sun May 14, 2006 2:09 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
SoylentGreen l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/19872352734460b326d699c.png)
Joined: 19 Aug 2005 Posts: 904 Location: The Hostel
|
Posted: Sun May 14, 2006 2:24 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
punter Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
Joined: 25 Nov 2002 Posts: 506
|
Posted: Sun May 14, 2006 2:26 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
NeddySeagoon Administrator
![Administrator Administrator](/images/ranks/rank-admin.gif)
![](images/avatars/3946266373f47d606a2db3.jpg)
Joined: 05 Jul 2003 Posts: 54847 Location: 56N 3W
|
Posted: Sun May 14, 2006 2:27 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
punter Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
Joined: 25 Nov 2002 Posts: 506
|
Posted: Sun May 14, 2006 2:39 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
|