Skip to content

Commit

Permalink
Re-work explanation of expansion speed (see #1340)
Browse files Browse the repository at this point in the history
  • Loading branch information
josephwright committed Nov 27, 2023
1 parent 630402e commit 66d321d
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions l3kernel/l3expan.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -310,23 +310,19 @@
%
% When speed is essential (for functions that do very little work and
% whose variants are used numerous times in a document) the following
% considerations apply because internal functions for argument expansion
% come in two flavours, some faster than others.
% considerations apply because the speed of internal functions that
% expand the arguments of a base function depend on what needs doing
% with each argument and where this happens in the list of arguments:
% \begin{itemize}
% \item
% Arguments that might need expansion should come first in the list
% of arguments.
% Arguments that are \emph{unchanged} by expansion (|N|- and |n|-type)
% should come last: the internal functions then avoid absorbing these
% entirely, giving a small speed gain.
% \item
% Arguments that should consist of single tokens |N|, |c|, |V|, or
% |v| should come first among these.
% \item
% Arguments that appear after the first multi-token argument |n|,
% |f|, |e|, or |o| require slightly slower special processing to be
% expanded. Therefore it is best to use the optimized functions,
% namely those that contain only |N|, |c|, |V|, and |v|, and, in the
% last position, |o|, |f|, |e|, with possible trailing |N| or |n| or
% |T| or |F|, which are not expanded. Any |x|-type argument causes
% slightly slower processing.
% Expansion to an |N|-type argument gives an internal result that
% can be manipulated faster than ones that expand to an |n|-type
% argument; thus any |c|-type expansion should come before |V|-,
% |v|-, |o|-, |e|-, |f|- or |x|-type.
% \end{itemize}
%
% \section{Manipulating the first argument}
Expand Down

0 comments on commit 66d321d

Please sign in to comment.