LATEX-L Archives

Mailing list for the LaTeX3 project


Options: Use Classic View

Use Monospaced Font
Show Text Part by Default
Condense Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Content-Type: text/plain; charset="us-ascii"
Date: Tue, 24 Nov 2009 13:58:09 +0000
Reply-To: Mailing list for the LaTeX3 project <[log in to unmask]>
From: "J.Fine" <[log in to unmask]>
Content-Transfer-Encoding: 8bit
In-Reply-To: <[log in to unmask]>
MIME-Version: 1.0
Sender: Mailing list for the LaTeX3 project <[log in to unmask]>
Parts/Attachments: text/plain (45 lines)
Joseph write:

> > Frank:  I don't understand what you mean by 'the overhead of
> processing'.)
> I assume Frank was thinking that we wouldn't want to do everything in a
> dictionary manner as some arguments are always needed, and so something
> like:
> \def\foo@bar#1#2{%
>   Title:   #1\\%
>   Name:    \DictionaryLookup{#2}{name}\\%
>   Address: \DictionaryLookup{#2}{address}\\%
> }
> will be faster for the explicitly passed #1 than the dictionary items,
> independent of how the dictionary is implemented. (I'd assume that a
> dictionary would be a single data structure: I'd probably do it as an
> expl3 properly list, and then recovering data would certainly add some
> processing overhead. However, even a csname expansion as you outline is
> an additional overhead compared to an explicitly passed value.)

The overhead you point to is slight, and there are worse offenders (such as the LaTeX3 programming language itself).

I also suspect that if you do the tests I think you'll find
  \expandafter\def\csname\endcsname{A longish piece of text}
  \def\mymacro #1{\csname\endcsname
will be quicker than
  \mymacro{A longish piece of text}
because of the reduced churning of tokens.  But I could be wrong.

Your revision of my
I strongly disagree with.  You've taken something simple that works, and changed it to something that is broken (because it assumes that all maps will be dictionaries).


The Open University is incorporated by Royal Charter (RC 000391), an exempt charity in England & Wales and a charity registered in Scotland (SC 038302).