Tag Info

Hot answers tagged

21

It was when the code was written, but is not now (in my opinion). The current LaTeX2e kernel was released in 1992 and carries forward a lot of material from LaTeX2.09. Even with these optimisations and the old 'autoload' system, there were a lot of systems that LaTeX was too big for on release. So looked at in the early 1990s this was entirely sensible. I'd ...


15

After some help from here, the following code seems to be pretty close to the original primitive. We look at the pdflatex release notes (2005-08-01) first \pdfelapsedtime is a read-only integer that (initially) returns the amount of time passed since the start of this run. This amount is given in `scaled seconds': the value 65536 counts as one ...


15

There are several causes here, but 39 seconds seems way too much. Your log file shows that your files are already in the cache format (temp-fontname.lua). fontspec loads a lot of instances during startup (\setmainfont). Each of them takes time. memory speed/limit can have a big impact. These lua tables tend to be huge and need to be parsed each time the ...


15

It does not have any serious impact on performance on modern machines and I can vouch on old machines as well. Depending on your settings more than 50% of text would normally pass through the first pass. Here is a figure of two tests (the red numbers denote badness): The tests were carried out using code posted by Wilson on Git. Personally I would ...


14

According to their website it can do this because it only formats one page at a time. Long documents -- TeX Word Performance I would like to clarify one misinformation that 'BaKoMa TeX Word is efficient only for short documents, because it runs TeX on background'. In one side it is true that BaKoMa TeX Word runs TeX to display document. This ...


14

For general benchmarking I use a macro \replicate attributed to David Kastrup, to iterate and two macros \startTimer, \stopTimer, based on \pdfsettimer and pdfelapsedtime. I use this for order of magnitude benchmarking (using pdfLaTeX). For example, here is a test routine, that calculates and typesets fibonacci numbers to compare the effect of using \num ...


13

Pipe support pdfTeX support pipes since version 1.40.0 (released 2007-01-01). From NEWS: shell escape: if the first character of a filename for \openin, \openout \input is a pipe symbol (|), the filename is assumed to be a request for a pipe to a command line that is given in the rest of the filename The feature is enabled in different ways ...


10

Short answer: no you can't. Long answer: fontspec uses luaotfload to load fonts. And luaotfload (which is based on ConTeXt's fontloader) needs a lot of information when you are in node-mode. This information is stored in big Lua tables that get loaded (created) when processing the document. And processing these tables take time. That said: it is possible to ...


9

If you don't have an application that needs to be optimized as much as you can, then do whatever you can read best. The one second you gain in your lifetime by waiting for a document to be processed 0.0001 second faster each time opposes many minutes / hours? by looking for the right definitions of your "optimized" macro names. This is true for all ...


9

Here the results of the gobble comparison. This tests runs the same command 1.000.000 times. It gobbles only empty arguments in this test. See also my comment below the question. The results are: Total times: real 0m5.422s user 0m5.360s sys 0m0.050s Results (in scaled seconds, 1/65536s) \expandafter \@gobbletwo \@gobble : 95638 \expandafter ...


8

No. I recall a former colleague, a Lisp hacker, who talked about when he switched from expressing pairs using (first . second) to (first second): the former needs two extra characters on the screen, the latter used an extra cons cell in the data representation. He changed when he realised he cared that little bit more about "screen estate" than data ...


8

At this (very small) amount of running time, the results are likely to be dominated by the implementation differences between the windows and linux system function calls that are used by pdftex. Pdftex does not run the same code on both platforms, and the function implementation that is used on Windows (ftime) is infamous for being unreliable at small ...


8

Ultimately, expl3's prop data type is constructed using a TeX macro (at the moment: we used to use token registers). When you assign to a prop, the assignment first needs to 'look' for the key before either adding a new key/value pair or replacing the value for an existing key. This is done using a delimited macro at the TeX level. So when you add to a prop, ...


7

Responding to the comments: Here is a test that is a bit more realistic. TeX file: \documentclass{article} \usepackage{ifthen} \newwrite\BenchmarkStream \def\startTimer{% \pdfresettimer \immediate\openout\BenchmarkStream=\jobname.dat } \def\stopTimer{% \immediate\write\BenchmarkStream{\number\pdfelapsedtime}% \immediate\closeout\BenchmarkStream } ...


5

A general rule in timing statistics: do not trust any value below 1 full second.


3

In this case, I'd say that's a reasonable way to measure the efficiency of loops. The body of each loop takes constant time as does the comparison. So the total time is just the combined time for the comparison and the body times the number of loop iterations. In this case, the \loop\repeat loop is going to be a little faster because it has slightly less ...


3

One approach, based on Heiko Oberdiek's answer to this question, and egreg's answer to a similar question is the code below. It's made more complicated because I don't know how to pass parameters to a lua script interpreted using texlua, so I hard-code the parameter \blf@time@base in the lua file each time a function is called. Since the absence of pipes ...



Only top voted, non community-wiki answers of a minimum length are eligible