Received: from mx0.gmx.net (mx0.gmx.net [213.165.64.100]) by h1439878.stratoserver.net (8.14.2/8.14.2/Debian-2build1) with SMTP id p3FKT5Mj027687 for ; Fri, 15 Apr 2011 22:29:06 +0200 Received: (qmail 32267 invoked by alias); 15 Apr 2011 20:29:00 -0000 Delivered-To: GMX delivery to rainer.schoepf@gmx.net Received: (qmail invoked by alias); 15 Apr 2011 20:28:59 -0000 Received: from relay2.uni-heidelberg.de (EHLO relay2.uni-heidelberg.de) [129.206.210.211] by mx0.gmx.net (mx118) with SMTP; 15 Apr 2011 22:28:59 +0200 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [129.206.100.94]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id p3FKQll2007658 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 15 Apr 2011 22:26:48 +0200 Received: from listserv.uni-heidelberg.de (localhost.localdomain [127.0.0.1]) by listserv.uni-heidelberg.de (8.13.1/8.13.1) with ESMTP id p3FDjg3j027596; Fri, 15 Apr 2011 22:26:47 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 1231901 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Fri, 15 Apr 2011 22:26:47 +0200 Received: from relay2.uni-heidelberg.de (relay2.uni-heidelberg.de [129.206.210.211]) by listserv.uni-heidelberg.de (8.13.1/8.13.1) with ESMTP id p3FKQlLq016646 for ; Fri, 15 Apr 2011 22:26:47 +0200 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.171]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id p3FKQeHI007606 for ; Fri, 15 Apr 2011 22:26:46 +0200 Received: from morse.mittelbach-online.de (p54A83DE8.dip.t-dialin.net [84.168.61.232]) by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis) id 0LbNoU-1PR0Nh3LA2-00kyH5; Fri, 15 Apr 2011 22:26:40 +0200 Received: by morse.mittelbach-online.de (Postfix, from userid 501) id C9E8774E17; Fri, 15 Apr 2011 22:26:36 +0200 (CEST) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit References: <4DA5C4E2.8090005@morningstar2.co.uk> <58AFBC3A-4209-4BC0-BB3A-5B14D6B5EFD8@gmail.com> <4DA727A9.2050903@morningstar2.co.uk> X-Mailer: VM 7.19 under Emacs 21.3.1 X-Provags-ID: V02:K0:SDT+GTyXr/LwUbkWcdEkxbPqgu7l9gl+XoCAvEz4EnX EieDRqwEkVT5VT9m0X3kzaptAVJTnQs7rCkVtbVsG0K6GP4/7M t+5JcDPWMRrNmfjIRNIdftff/UTu0JlfB/dB8T/qGxDK7W9ngU 4tfe7vnRc73hWVA8A5sjNkzdHK+AYhZ4ARKDRy1LsOCA7Bhye6 dn3USyvf/jKIYf9eT0wMA== X-Spam-Whitelist-Provider: Message-ID: <19880.43516.366891.822111@morse.mittelbach-online.de> Date: Fri, 15 Apr 2011 22:26:36 +0200 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Frank Mittelbach Subject: Re: The nature of popping from an empty sequence To: LATEX-L@listserv.uni-heidelberg.de In-Reply-To: <4DA727A9.2050903@morningstar2.co.uk> Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: X-GMX-Antispam: 0 (eXpurgate); Detail=5D7Q89H36p75bLVJkeBFOAqOn/PdRTjI+HWCw/OIW2B9DjafB9NDTOYi38Hb4hqrI2lxi JvTFIs/Ka5Hdr0HGfIndssQmlF+wPeOMT/SFS2Q810s/78knUPh27CqWg39rYFEoOhfMY7aho85b tuudWnkmbnfM56/AzqPcQTqZSr4n58ZNfMOOVEP6xPuCIdsGs0b4/BNDXCbql/ltvPsGw==V1; X-Resent-By: Forwarder X-Resent-For: rainer.schoepf@gmx.net X-Resent-To: rainer@rainer-schoepf.de Status: R X-Status: X-Keywords: X-UID: 6707 Joseph Wright writes: > 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. right let's worry about performance (you know I do that quite often :-) > 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} well try this one as well which is what I was thinking of (kind of): \cs_new:Npn \prop_get:NnNF #1#2#3#4 { \prop_get:NnN #1 {#2} #3 \quark_if_no_value:NF { \cs_set_eq:NN #3 \c_undefined #4 } } \pdfresettimer \prg_replicate:nn { 50000 } { \prop_get:NnNF \test { a } \testa { } } \showthe\pdfelapsedtime > 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. basically it tells us that \prop_if_in:Nn is fairly inefficient and that in turn is due to it using \quark_if_no_value:nTF I guess. Saving the result and then checking it is much much faster. Perhaps that implementation should change. frank