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