- does using \doifundefined{myMacro}{...} shorten tex runs/compile time ? - what are the features to avoid for shortest compile times ? -- Alan
Am 23.02.2009 um 18:16 schrieb Alan Stone:
- does using \doifundefined{myMacro}{...} shorten tex runs/compile time ?
In which way?
- what are the features to avoid for shortest compile times ?
Depends on your document and what do you want. To give you a better answer speak in complete sentences. Wolfgang
On Mon, Feb 23, 2009 at 6:54 PM, Wolfgang Schuster < schuster.wolfgang@googlemail.com> wrote:
Am 23.02.2009 um 18:16 schrieb Alan Stone:
- does using \doifundefined{myMacro}{...} shorten tex runs/compile time ?
In which way?
As I don't know/understand what happens between (Lua)TeX runs, to keep macro definitions in memory. - what are the features to avoid for shortest compile times ?
Depends on your document and what do you want.
My question was intended in a generic way, aka if you use - these features ... expect longer or significant longer compile times, or - these features ... generate the longest compile times.
To give you a better answer speak in complete sentences.
Wolfgang
On Mon, Feb 23, 2009 at 8:57 PM, Alan Stone
On Mon, Feb 23, 2009 at 6:54 PM, Wolfgang Schuster < schuster.wolfgang@googlemail.com> wrote:
Am 23.02.2009 um 18:16 schrieb Alan Stone:
- does using \doifundefined{myMacro}{...} shorten tex runs/compile time ?
In which way?
As I don't know/understand what happens between (Lua)TeX runs, to keep macro definitions in memory.
Correction: to avoid spending time redefining macros in case their definitions are kept in memory between Lua(TeX) runs.
- what are the features to avoid for shortest compile times ?
Depends on your document and what do you want.
My question was intended in a generic way, aka if you use
- these features ... expect longer or significant longer compile times, or - these features ... generate the longest compile times.
To give you a better answer speak in complete sentences.
Wolfgang
On Mon, Feb 23, 2009 at 9:26 PM, Alan Stone
On Mon, Feb 23, 2009 at 8:57 PM, Alan Stone
wrote: On Mon, Feb 23, 2009 at 6:54 PM, Wolfgang Schuster
wrote: Am 23.02.2009 um 18:16 schrieb Alan Stone:
- does using \doifundefined{myMacro}{...} shorten tex runs/compile time ?
In which way?
As I don't know/understand what happens between (Lua)TeX runs, to keep macro definitions in memory.
Correction: to avoid spending time redefining macros in case their definitions are kept in memory between Lua(TeX) runs.
$>context test.tex is roughly finish :=false while not(finish): run_luatex_with_context_format_on_file(test.tex) where run_luatex_with_context_format_on_file(filename) is my imaginary name that run luatex (for example on my system luatex --fmt="/opt/luatex/minimals/tex/texmf-cache/luatex-cache/context/4330c3ed7721ca11f9d108c60c58eea4/formats/cont-en" --lua="/opt/luatex/minimals/tex/texmf-cache/luatex-cache/context/4330c3ed7721ca11f9d108c60c58eea4/formats/cont-en.lua" "./test.tex" ) but also check conditions to that change finish to true and possible write intermediate files. So,as far I know, each run is a new process: there is no a master process that spawns new children , and no definitions are kept in memory between Lua(TeX) runs. -- luigi
Alan Stone wrote:
Correction: to avoid spending time redefining macros in case their definitions are kept in memory between Lua(TeX) runs.
i'm not sure what you mean, but defining a bunch of macros at runtime is not that time consuming Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Am 23.02.2009 um 20:57 schrieb Alan Stone:
- does using \doifundefined{myMacro}{...} shorten tex runs/compile time ?
In which way?
As I don't know/understand what happens between (Lua)TeX runs, to keep macro definitions in memory.
The only way to use information from a previous run is to use the auxiliary files or buffers. Macros are defined at each run again but you shouldn't care here about the performance unless you use a very big private module.
- what are the features to avoid for shortest compile times ?
Depends on your document and what do you want.
My question was intended in a generic way, aka if you use
- these features ... expect longer or significant longer compile times, or - these features ... generate the longest compile times.
As Taco mentioned, try to avoid \switchtobodyfont and use \definedfont or \definefont instead. You can also gain a few (micro)seconds when you run TeX in batchmode (no terminal messages). Natural Tables are quite slow and it's sometimes worth to take a look if you can use table or tabulate. Wolfgang
maybe someone should research LuaJIT; http://luajit.org/ lua vs luajit; http://shootout.alioth.debian.org/u32q/benchmark.php?test=all&lang=luajit&lang2=lua&box=1 thoughts? Alan Stone wrote:
- does using \doifundefined{myMacro}{...} shorten tex runs/compile time ?
- what are the features to avoid for shortest compile times ?
-- Alan
------------------------------------------------------------------------
___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
Mohamed Bana wrote:
maybe someone should research LuaJIT; http://luajit.org/
The fine print on LuaJIT: * Only x86 (i386+) CPUs are supported right now (but see below). That is the first, main reason why luajit is not included in luatex yet. The other reason is that we don't expect that much improvement because most of the lua code inside luatex is not running at full interpreter speed anyway: mkiv is spending much of its time in creating tables and table keys and the garbage collector (we benchmarked this) neither of those task will benefit from luajit. There would be some speed gain, but not a lot. I am waiting for luajit 2.0 and hoping it will support more architectures. Best wishes, Taco
Mohamed Bana wrote:
maybe someone should research LuaJIT; http://luajit.org/
lua vs luajit; http://shootout.alioth.debian.org/u32q/benchmark.php?test=all&lang=luajit&lang2=lua&box=1
thoughts?
i wonder if it makes much of a difference in the way we use lua; most time is currently spent on function calls and tex-lua interfacing and if i'm right jit does not help much there long ago i did some tests and jut is indeed impressive but for larger functions (and we have many of them) you need to tune parameters in order to gain something once luatex is finished we can look into it again but keep in mind that jit is only available for someplatforms/architectures (btw i do lots if speed tests when writing lua code for mkiv, so often the code is already rather optimized) Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Alan Stone wrote:
- does using \doifundefined{myMacro}{...} shorten tex runs/compile time ?
not that much
- what are the features to avoid for shortest compile times ?
most code is rather optimized you can best avoid redundant font switches ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
participants (6)
-
Alan Stone
-
Hans Hagen
-
luigi scarso
-
Mohamed Bana
-
Taco Hoekwater
-
Wolfgang Schuster