6

This question may seem like it's been asked a million times over, but the relevant questions tackle XeLaTeX or plain LaTeX. What I want to know is if moving any filesystems/file locations to a dedicated RAMdisk would help more quickly compile LuaTeX?

Reading the previous questions, it seems that the consensus is that it's basically the CPU/Intel processor that is the key bottleneck. However, this comment notes that when using certain fonts, the OS/filesystem performance does play a role as it affects font loading. I use LuaTeX exclusively as I have a self-made package which uses MinionMath and ArnoPro, as well as some other fonts for certain symbols. For this reason, and because of that comment, I'm wondering if maybe for this specific case moving some filesystems/file locations to the RAMdisk could be helpful in speeding up performance?

I understand that LuaTeX isn't as fast as other compilers, and especially my custom package is ridiculously demanding (LOTS of additional commands and customisations, and using otf fonts of ArnoPro in all sizes and types, and MinionMath font, as well as 13 other packages preloaded into it which are absolutely necessary -- trust me on this one!) so I understand that it will still be relatively slow. However, even having the time cut by half or a quarter would be great! So, would this idea work? And how would I go about it (i.e. which filesystems/locations specifically would I move)? I use Linux 17.1 Cinnamon if it helps. Thanks!

EDIT: Thanks to a good point about LuaJIT that was brought up, I found further commentary on the font debacle here. The comments in that specific thread are revealing, and help point out my problem with fonts specifically as the major issue, not the OS or compiler or etc. It's not clear that LuaJIT (with JIT on or off) would help the issue much, as font loading takes the vast majority of the time (probably with fontforge libraries or similar, no idea). That is the biggest issue. (Also, the links for downloading LuaJIT require a password now!)

airatin
  • 303
  • 2
    Related: Tips for choosing hardware for best LaTeX compile performance -- answer indicates that disk I/O will get cached in memory pretty easily, and won't be significant. You could always build a 4GB ramdisk with mkdir /usr/local/texlive; mount -t tmpfs -o size=4G,mode=755 tmpfs /usr/local/texlive and see what happens if you install TL 2014 there versus to the regular disk. – Mike Renfro Jan 04 '15 at 01:57
  • 1
    "ridiculously demanding" in what sense? IO or CPU? Lua is very fast. Try luajittex (with and without jit enabled) to see if this speeds up things. But as with every performance question: measure it. It is hard to guess where the performance bottleneck is. You could even write your own font loader if you need more performance... – topskip Jan 04 '15 at 13:09
  • @topskip thank you for the information! Please see the question edited in response :) – airatin Jan 04 '15 at 23:46
  • @MikeRenfro Considering it is font loading that is the biggest issue, I don't see how installing texlive in the ramdisk would be of significant help? – airatin Jan 04 '15 at 23:46
  • Are your fonts not in the TL tree? If not, I'm wrong. – Mike Renfro Jan 05 '15 at 04:11
  • @MikeRenfro they were in the texmf folder under /usr/local/share but still that's a good point! I didn't consider that until now. How would I install TL in RAM (and make sure it stays there whenever the laptop gets rebooted)? I've been using Linux's Software Manager the entire time so not sure how this would work :( – airatin Jan 05 '15 at 05:06
  • You can download luajittex without a password here: http://minimals.contextgarden.net/current/bin/luatex/ – topskip Jan 05 '15 at 10:29
  • @topskip thank you for the link! Now all I need to do is know how to build that raw binary, which I'm failing to understand :( I have luajittex but no idea how to install it (I put that file in /usr/bin but there's no fmt file!) – airatin Jan 05 '15 at 13:26
  • @airatin This is a question I can't answer, but I think if you ask here (new question), you'll get an easy answer by the local experts. I don't use these binaries with LaTeX, just with my own "macro" package. – topskip Jan 05 '15 at 13:30
  • This is becoming off-topic for the TeX site, but the short version would be: install upstream TL from the ISO into /usr/local/texlive as the default. Rename /usr/local/texlive to /usr/local/texlive.disk. Make a 4GB RAM disk of /usr/local/texlive.ram, and copy all the /usr/local/texlive.disk files there. Make a symbolic link from /usr/local/texlive to /usr/local/texlive.disk or /usr/local/texlive.ram as needed to switch between the two. I really don't expect it'll make a ton of difference, since Linux tends to aggressively cache disk activity in RAM anyway. – Mike Renfro Jan 05 '15 at 19:34
  • @airatin There is luajittex in TeXlive, but as the name says it only typesets TeX. You probably want to typeset LaTeX. Therefore you have to build the corresponding format. For instructions see this comment. – Henri Menke Aug 02 '16 at 13:28
  • @MikeRenfro Usually, LuaTeX caches font information in the user's var directory e.g. under ~/.texlive. If the bottleneck is loading fonts, putting TL on a ram disk won't do diddly squat, even if the fonts are part of TL which they mostly are not in this case. @ OP Never modify directories managed by your system's package manager directly e.g. /usr/bin. This way madness lies. – cfr Dec 24 '16 at 04:03
  • @cfr So instead of putting TL in ramdisk, he could symlink his ~/.texlive folder into the ramdisk. – Mike Renfro Dec 26 '16 at 16:10
  • @MikeRenfro He could. I wouldn't, but the OP could. I would at least check first (1) that the OP is not relying on persistence, (2) that the system is not already swapping to disk or would be swapping to disk and (3) how large ~/.texliveYYYY is. It is probably small, but worth checking just to be safe. – cfr Dec 26 '16 at 17:04

0 Answers0