From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/113421 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Rik Kabel via ntg-context Newsgroups: gmane.comp.tex.context Subject: Re: directsetup vs setups Date: Mon, 15 Nov 2021 13:06:49 -0500 Message-ID: <9ca345bf-bcb7-0e13-262e-830563326384@panix.com> References: <9314580b-537f-a406-0bab-4db53c71d8bf@rik.users.panix.com> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2964152267048491128==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26397"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0 Thunderbird/91.3.0 Cc: Rik Kabel To: Hans Hagen via ntg-context Original-X-From: ntg-context-bounces@ntg.nl Mon Nov 15 19:07:21 2021 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane-mx.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mmgO0-0006d3-Gg for gctc-ntg-context-518@m.gmane-mx.org; Mon, 15 Nov 2021 19:07:20 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 2515428931D; Mon, 15 Nov 2021 19:06:57 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DXmhgxQXEhGr; Mon, 15 Nov 2021 19:06:55 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id C5FA028933C; Mon, 15 Nov 2021 19:06:55 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 0065E28931D for ; Mon, 15 Nov 2021 19:06:54 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ReiOWD51h6dw for ; Mon, 15 Nov 2021 19:06:52 +0100 (CET) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=166.84.1.89; helo=mailbackend.panix.com; envelope-from=rik@panix.com; receiver= Original-Received: from mailbackend.panix.com (mailbackend.panix.com [166.84.1.89]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 4ECE928930F for ; Mon, 15 Nov 2021 19:06:51 +0100 (CET) Original-Received: from [192.168.1.106] (cpe-69-204-136-231.nycap.res.rr.com [69.204.136.231]) by mailbackend.panix.com (Postfix) with ESMTPSA id 4HtHFk2Jtlz42N5 for ; Mon, 15 Nov 2021 13:06:50 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=panix.com; s=panix; t=1636999610; bh=obQSZzSacJLLGV8D7xTv0XcjEt5Y+VTiicjatmrUiaY=; h=Date:Subject:To:References:From:In-Reply-To; b=cyYrhdxpve7mm5QcrCE7SC6jXVcShhmQzP5iR4hT5zCXkr8Klcrt83prSaWgEBhk/ ZbhjIc0zRroMTTX26SRjowrVXxLN6GFmbAsEq2iOPaY7TMzC2hGclfdMpJvLV7lLg8 t3o1+v3p0Te9sz/pTreQ0BAZPKiBEHyICaEA6gXw= Content-Language: en-US In-Reply-To: X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.io gmane.comp.tex.context:113421 Archived-At: This is a multi-part message in MIME format. --===============2964152267048491128== Content-Type: multipart/alternative; boundary="------------LyXeTJdSYjztudzSRPcIshSF" Content-Language: en-US This is a multi-part message in MIME format. --------------LyXeTJdSYjztudzSRPcIshSF Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2021-11-15 04:38, Hans Hagen via ntg-context wrote: > On 11/15/2021 6:24 AM, Rik Kabel via ntg-context wrote: >> Hello list, >> >> Can anyone provide a description of, or a point to a description of, >> the differences between setups= and directsetup= for including >> setups? I searched the list archive and the documents and found >> nothing. (That may indicate my level of search foo, but nonetheless I >> am in need of help with this.) > \setup      : takes a list ({...} or [...]) > \directsetup: supports gridsnapping, only one setup > \fastsetup  : the fastest, only one setup > > concerning performance, i wonder if you'll notice it > > \starttext >     \startsetups test >     \stopsetups > >     \testfeatureonce{100000}{\setup      {test}} \elapsedtime \par >     \testfeatureonce{100000}{\setup      [test]} \elapsedtime \par >     \testfeatureonce{100000}{\directsetup{test}} \elapsedtime \par >     \testfeatureonce{100000}{\fastsetup  {test}} \elapsedtime \par > \stoptext > > because often what's done in the setup is taking the time, just test > >     \startsetups test >         {\bf} >     \stopsetups > > you can volunteer to wikify it > > Hans Happy to wikify once I understand it. On your empty performance test, I get around 0.10, .11, .08 for direct, and 0.4 for fast. With the grouped styling, those balloon to 0.50, 0.56, 0.48, and 0.44. So, some follow-up questions: 1. What do you mean by "only one setup" in the description of directsetup and fastsetup? I have examples of using two different directsetup in one after key, so it does not seem to mean that. 2. What is meant by saying that directsetup supports gridsnapping? Do you mean that fastsetup does not? (If that is the case, should a module writer not use fastsetup because it might be used in a document that requires a grid?) 3. Is the support for {} and [] in setup simply to maintain legacy support for {}, or are there reasons to choose one over the other? I do see consistently faster times with the curlies. 4. Are there operations that are supported in directsetup that are not supported in setup or fastsetup? Are there operations supported in fastsetup that are not supported in setup or directsetup? 5. Is it fair to say that setup can do the most, directsetup a bit less, and fastsetup is the most restrictive? Except for the most performance-constrained documents, setup is a safe choice, but when constructing modules or performance tuning, the others might be tested? -- Rik --------------LyXeTJdSYjztudzSRPcIshSF Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
On 2021-11-15 04:38, Hans Hagen via ntg-context wrote:
On 11/15/2021 6:24 AM, Rik Kabel via ntg-context wrote:
Hello list,

Can anyone provide a description of, or a point to a description of, the differences between setups= and directsetup= for including setups? I searched the list archive and the documents and found nothing. (That may indicate my level of search foo, but nonetheless I am in need of help with this.)
\setup      : takes a list ({...} or [...])
\directsetup: supports gridsnapping, only one setup
\fastsetup  : the fastest, only one setup

concerning performance, i wonder if you'll notice it

\starttext
    \startsetups test
    \stopsetups

    \testfeatureonce{100000}{\setup      {test}} \elapsedtime \par
    \testfeatureonce{100000}{\setup      [test]} \elapsedtime \par
    \testfeatureonce{100000}{\directsetup{test}} \elapsedtime \par
    \testfeatureonce{100000}{\fastsetup  {test}} \elapsedtime \par
\stoptext

because often what's done in the setup is taking the time, just test

    \startsetups test
        {\bf}
    \stopsetups

you can volunteer to wikify it

Hans
Happy to wikify once I understand it.

On your empty performance test, I get around 0.10, .11, .08 for direct, and 0.4 for fast. With the grouped styling, those balloon to 0.50, 0.56, 0.48, and 0.44.

So, some follow-up questions:

  1. What do you mean by "only one setup" in the description of directsetup and fastsetup? I have examples of using two different directsetup in one after key, so it does not seem to mean that.
  2. What is meant by saying that directsetup supports gridsnapping? Do you mean that fastsetup does not? (If that is the case, should a module writer not use fastsetup because it might be used in a document that requires a grid?)
  3. Is the support for {} and [] in setup simply to maintain legacy support for {}, or are there reasons to choose one over the other? I do see consistently faster times with the curlies.
  4. Are there operations that are supported in directsetup that are not supported in setup or fastsetup? Are there operations supported in fastsetup that are not supported in setup or directsetup?
  5. Is it fair to say that setup can do the most, directsetup a bit less, and fastsetup is the most restrictive? Except for the most performance-constrained documents, setup is a safe choice, but when constructing modules or performance tuning, the others might be tested?
--
Rik
--------------LyXeTJdSYjztudzSRPcIshSF-- --===============2964152267048491128== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============2964152267048491128==--