From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 1460 invoked from network); 8 Dec 2023 21:38:13 -0000 Received: from cgl.ntg.nl (5.39.185.202) by inbox.vuxu.org with ESMTPUTF8; 8 Dec 2023 21:38:13 -0000 Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id E2414483C10 for ; Fri, 8 Dec 2023 22:37:26 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Received: from cgl.ntg.nl ([127.0.0.1]) by localhost (cgl.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fV3jD6fgWbAW for ; Fri, 8 Dec 2023 22:37:26 +0100 (CET) Received: from cgl.ntg.nl (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 17C8A483B1B for ; Fri, 8 Dec 2023 22:36:55 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 9FA6F483ADD for ; Fri, 8 Dec 2023 22:36:32 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Received: from cgl.ntg.nl ([127.0.0.1]) by localhost (cgl.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SCd8aMvY_erI for ; Fri, 8 Dec 2023 22:36:31 +0100 (CET) Received: from seout14.web-dns1.com (seout14.web-dns1.com [68.168.119.166]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by cgl.ntg.nl (Postfix) with ESMTPS id EB2E7483AB8 for ; Fri, 8 Dec 2023 22:36:31 +0100 (CET) Received: from mailpro1.whc.ca ([51.79.16.13]) by se2.web-dns1.com with esmtps (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rBiWJ-002DEY-Rg for ntg-context@ntg.nl; Fri, 08 Dec 2023 16:36:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=jdvb.ca; s=default; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:To:From:Date:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Dm+Jq6Wv+OnHdzvBmc8DsG1Y/q47SM97O42Q4v4h+Rw=; b=NFovlachsRlxNxbihWvpIgGOkT mv2/6qk5Pu/spbDVmh65tjxFalcVHHuePpKx8/WZTnoT/RZ0T+k2n17UPfUclTyK33xJ+Vdpj+fUK vsHlebKeLeqVRRAWUY9zL2iKDgEtOIT8GXd+gwzibl63dGX9jUZbGO47cYLdPxLgUtrHAJfM7onYK fQMAammA9Ng/GVVCcA4ZuKOPRJMS8/u7LM/JMls3Z7m6gdfbMDUQ0P2mw8sz1fjHoV/LZxX3jtS9C QatnKg0REvu5YIcjx+umonKjIvcFRcf1BSBGjcdjwqO9l7fwIiq8y7O37xrl9Tv3gR+6zISFEx6eg sGZesrhQ==; Received: from [47.55.144.2] (port=48676 helo=x360) by mailpro1.whc.ca with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1rBiWD-003osM-0r for ntg-context@ntg.nl; Fri, 08 Dec 2023 16:36:27 -0500 Received: by x360 (Postfix, from userid 1000) id B8A241E0AD3; Fri, 8 Dec 2023 17:36:20 -0400 (AST) Date: Fri, 8 Dec 2023 17:36:20 -0400 From: Jim To: mailing list for ConTeXt users Message-ID: References: <913fa7c5-a9fc-4edf-909f-f7805e97aaa3@freedom.nl> <66910cf4-f19d-4400-a90c-adf1bb66a4d7@xs4all.nl> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <66910cf4-f19d-4400-a90c-adf1bb66a4d7@xs4all.nl> X-Microslop: Just say no X-Originating-IP: 51.79.16.13 X-SpamExperts-Domain: out.mailpro1.whc.ca X-SpamExperts-Username: 51.79.16.13 Authentication-Results: web-dns1.com; auth=pass smtp.auth=51.79.16.13@out.mailpro1.whc.ca X-SpamExperts-Outgoing-Class: ham X-SpamExperts-Outgoing-Evidence: Combined (0.28) X-Recommended-Action: accept X-Filter-ID: Pt3MvcO5N4iKaDQ5O6lkdGlMVN6RH8bjRMzItlySaT+M1RrfrCdUKsK/c0MshAJ7PUtbdvnXkggZ 3YnVId/Y5jcf0yeVQAvfjHznO7+bT5x+OkQ6e4TPVgvpcS1fNw4ZIpdOJ9Sgfu6rKL8kf6cp2UZq jqPp8/zHxeisaO2OhLLilbHtbFYVmmyNP/jzd7CCzPgfBgZM0FjuQW6Y55dUiQZmnW/XN+tohdLu D74c7RLUIMwTX/CvUEM55+RnwH9cg8CBO1Snvm6qXHQp7O9kdZPt1ptJqUeJtZx82lIVH48BGzKf EMfQP5IsMlZ0RJfOLDnQGgRgHjioU8fpt7xeC7AK0L/uTNt3WCw41GzGb1Zq+pu9ho29CVyp3Dt9 A9c5hLgYgFsBSgLe7UmHHVjYG9GnC3OL+6eaioOqJ1MVeBS8xyVOjEJvIAACfll1FjMqX1/meW3M G7kx6XXEd8YzfeZE7YJwhBWCb1PmFojBOyjXs2KsRjKrCowEavDwQuKo3bSrXfKp2XsEXUBafcEf xV8Coej5pI7/nMRAwrsF7/9g5p66If/IR1kfxLX5OBwkE6OHS8/FxA6Moo6tghBinBqZR3KVQgqF /fPYYAfEfsgwk5X5rCZeYz/3TkV2eDAGCFkowjXOBEPmC0yHFVrEr9++ergWxXwMx3R2VOasPrsZ U/9HqfWQZiE3AkP7WzFvTMm+RdW/uBJnu3u5UnmMUAjc02b5jkFQobPtfIMRZKkf45ZSyy4dc2Mg P6Eqbf2YMR3EqJ9Y5oosudd3N5Sg6nZ/NG7yVbVITUmnPVcwl9mZmIywXcIPqUm6fhU6IRxOXPWl FdaGOH191uXjgjQN/WFpsZaZSrHKzi9a18qWWyBuSt2KGbzCxGga80a3XdQOkqPmIeW3IkXkaI0b vQblVXM6mCHEVkRugaawCPSl0iZvgRtea07paRiSLL2ShuV4mfeo0mGANbykyMXhXrMXF2RCocjQ L9Td+ZGFmhHYC7ptQrmVr+hFcAVxMUxHqhIhgeQKvt8SGOaF6j7hHdgTCw== X-Report-Abuse-To: spam@se1.web-dns1.com Message-ID-Hash: SCNP5A6YZOOPV2HBN2FHHKHPCINSPAWF X-Message-ID-Hash: SCNP5A6YZOOPV2HBN2FHHKHPCINSPAWF X-MailFrom: zlists+context@jdvb.ca X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list Reply-To: mailing list for ConTeXt users Subject: [NTG-context] Re: mtx-synctex.lua question List-Id: mailing list for ConTeXt users Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Fri, Dec 8, 2023 at 21:18 (+0100), Hans Hagen wrote: > On 12/8/2023 7:51 PM, Jim wrote: >> Hi Hans (and anyone else interested in synctex), >> 282a284,285 >>> locate( 0, s) if fi ~= 0 then tl = s ; goto done end >>> locate( 0,-s) if fi ~= 0 then tl = s ; goto done end >> and then wrote the following quick and dirty shell script to create log >> files for comparison: > ok >> Admittedly, with the other two directions added in, a more extensive test >> (a total of a bit under 14 minutes CPU time on a Ryzen 4700U) showed the >> new version is about 0.5% slower, so there is a very minor downside. (I'd >> happily spend the extra matches for the minuscule amount of CPU time, but >> others may not.) > the .5% precen tis no big deal, also because this script is not that time > critical (the code could be made a bit faster anyway) so i'll add the few > lines Great. If nothing else, it will keep other people from asking the same question in the future. :-) > so those 14 minutes, was that N times a file or 1 time a huge file? N times a file: I swiped the code from the program and defined two functions, one (test_old) one for the current code and one for the new code: test_new () { for x in $=x_vals do for y in $=y_vals do printf "%3d, %3d: " $x $y out=`mtxrun --script mtx-synctex-jd.lua --goto --direct \ --page=$page --x=$x --y=$y --tolerance=$tolerance $st_file` echo $out done done } (The test_old was the same except for the argument to --script, which is 'synctext'.) I defined $page=15, $tolerance=300 and $st_file to be a file with 3441 lines (there are 19 pages in total, so I was skipping a lot of stuff) and changed x_vals and y_vals to create a lot of iterations: x_vals=`seq 100 5 550` y_vals=`seq 100 5 700` and finally I ran time (test_new > /dev/null) and time (test_old > /dev/null) So mtxrun was called for each of these 11,011 times. Not the best possible benchmark, but probably good enough to show that adding the other two cases isn't hurtful. Cheers. Jim ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___________________________________________________________________________________