bachotex-2013-speed.tex /size: 3790 b    last modification: 2020-07-01 14:35
1% \enablemode[print]
2
3\usemodule[pre-stepwise,present-tiles,abr-02]
4
5\definecolor[maincolor] [darkgray]
6\definecolor[othercolor][r=.3,g=.3]
7
8% \setupinteractionscreen
9%   [option=max]
10
11\setupbodyfont[15pt]
12
13\startdocument
14  [title={Speed:\\\\can we make\\it any faster},
15   subtitle={Hans Hagen\\EuroBacho\TeX\\May 2013}]
16
17\StartSteps
18
19\starttopic[title={Speed}]
20
21    \startitemize
22        \startitem speed matters in a edit-run-preview cycle although this is mostly perception \FlushStep \stopitem
23        \startitem the nicer the interface, the slower it gets, but you seldom set something up \FlushStep \stopitem
24        \startitem everything you provide gets used at some point, also in inefficient ways \FlushStep \stopitem
25        \startitem lots of local (grouped) tweaks leads to many mechanisms kicking in unseen \FlushStep \stopitem
26        \startitem wrong use of functionality can have drastic and unexpected speed penalties \FlushStep \stopitem
27    \stopitemize
28
29\stoptopic
30
31\StopSteps
32
33\StartSteps
34
35\starttopic[title={Pages per minute}]
36
37    \startitemize
38        \startitem we try to speed up baseline performance (in pages per second) \FlushStep \stopitem
39        \startitem identify and optimize critical routines, both at the \TEX\ and \LUA\ end \FlushStep \stopitem
40        \startitem of course the machine (Dell M90, SSD, 4GB, 2.33 Ghz T7600, Windows 8) and versions if \LUATEX\ (0.72+) and \CONTEXT\ matter \FlushStep \stopitem
41    \stopitemize
42
43    \blank
44
45    \starttyping
46    \dorecurse {1000} {test \page}
47    \stoptyping
48
49    \FlushStep
50
51    \blank
52
53    \starttabulate[|r|r|r|r|]
54    \HL
55    \NC \bf \# pages \NC \bf Januari \NC \bf April \NC \bf May\rlap{\quad(2013)} \NR
56    \HL
57    \NC     1 \NC   2 \NC   2 \NC   2 \NC \NR
58    \NC    10 \NC  15 \NC  17 \NC  17 \NC \NR
59    \NC   100 \NC  90 \NC 109 \NC 110 \NC \NR
60    \NC  1000 \NC 185 \NC 234 \NC 259 \NC \NR
61    \NC 10000 \NC 215 \NC 258 \NC 289 \NC \NR
62    \HL
63    \stoptabulate
64
65    \FlushStep
66
67\stoptopic
68
69\StopSteps
70
71\StartSteps
72
73\starttopic[title={What happens}]
74
75    \startitemize
76        \startitem load macros and \LUA\ code is loaded from the format \FlushStep \stopitem
77        \startitem the system gets initialized, think of fonts and languages \FlushStep \stopitem
78        \startitem additional (runtime) files are loaded \FlushStep \stopitem
79        \startitem text is typeset and eventually gets passed to the page builder \FlushStep \stopitem
80        \startitem pages are packaged, this includes reverting to global document states \FlushStep \stopitem
81        \startitem the \PDF\ representation is created \FlushStep \stopitem
82        \startitem each of these steps has its bottlenecks \FlushStep \stopitem
83        \startitem the more we don, the more \LUA\ gets involved \FlushStep \stopitem
84    \stopitemize
85
86\stoptopic
87
88\StopSteps
89
90\StartSteps
91
92\starttopic[title={What we can do}]
93
94    \startitemize
95        \startitem avoid copying boxes where possible \FlushStep \stopitem
96        \startitem only enable initializers and finalizers when functionality is used \FlushStep \stopitem
97        \startitem be clever with fonts, in usage as well as in supporting features \FlushStep \stopitem
98        \startitem use trial runs in multi||pass mechanisms \FlushStep \stopitem
99        \startitem avoid too much macro expansion (only matters for tracing) \FlushStep \stopitem
100        \startitem accept that more functionality has a price \FlushStep \stopitem
101    \stopitemize
102
103    but
104
105    \startitemize
106        \startitem don't compromise functionality \FlushStep \stopitem
107        \startitem avoid too obscure code \FlushStep \stopitem
108        \startitem forget about optimization by means of combining functionality \FlushStep \stopitem
109    \stopitemize
110
111\stoptopic
112
113\StopSteps
114
115\stopdocument
116