LATEX-L Archives

Mailing list for the LaTeX3 project

LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

Options: Use Classic View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

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

Print Reply
Joseph Wright <[log in to unmask]>
Thu, 14 Apr 2011 17:58:17 +0100
text/plain (42 lines)
On 14/04/2011 09:44, Will Robertson wrote:
> * These should probably be consistent.
> * I think returning a quark is dangerous in case of sloppy package authors.

If we want consistency between \seq_... and \prop_..., then that is fine
but we also need to worry about performance. I'm worried about property
lists, as they are used a lot in siunitx. With the short test file

  \documentclass{article}
  \usepackage{expl3}
  \begin{document}
  \ExplSyntaxOn
  \prop_new:N \test
  \tl_new:N \testa
  \prop_put:Nnn \test { a } { b }
  \pdfresettimer
  \prg_replicate:nn { 10000 }
    {
      \prop_get:NnN \test { a } \testa
      \quark_if_no_value:NTF \test { } { }
    }
  \showthe\pdfelapsedtime

  \pdfresettimer
  \prg_replicate:nn { 10000 }
    {
      \prop_if_in:NnTF \test { a }
        {
          \prop_get:NnN \test { a } \testa
        }
        { }
    }
  \showthe\pdfelapsedtime
  \end{document}

I find that the quark-based approach is about twice as fast as using
\prop_if_in:Nn. Granted, this is somewhat artificial, but I do
essentially this a lot inside siunitx and do not really want to loose
speed if I can avoid it.
-- 
Joseph Wright

ATOM RSS1 RSS2