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