From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Karthik Chikmagalur Newsgroups: gmane.emacs.devel Subject: Re: Understanding filter function calls Date: Thu, 27 Jul 2023 14:44:21 -0700 Message-ID: <87mszh113e.fsf@gmail.com> References: <87y1j5vp3y.fsf@gmail.com> <96ad3a89-a0bd-6f8a-6251-d3f2f201e4f7@vodafonemail.de> <87pm4d12rc.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9038"; mail-complaints-to="usenet@ciao.gmane.io" To: Jens Schmidt , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jul 28 00:02:20 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qP93r-0002ES-PG for ged-emacs-devel@m.gmane-mx.org; Fri, 28 Jul 2023 00:02:19 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qP8mh-0001F3-DG; Thu, 27 Jul 2023 17:44:35 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qP8mY-0001D7-VM for emacs-devel@gnu.org; Thu, 27 Jul 2023 17:44:28 -0400 Original-Received: from mail-oi1-x22d.google.com ([2607:f8b0:4864:20::22d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qP8mX-0004Vb-Ek for emacs-devel@gnu.org; Thu, 27 Jul 2023 17:44:26 -0400 Original-Received: by mail-oi1-x22d.google.com with SMTP id 5614622812f47-3a425ef874dso1207958b6e.0 for ; Thu, 27 Jul 2023 14:44:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690494263; x=1691099063; h=mime-version:message-id:date:references:in-reply-to:subject:to:from :from:to:cc:subject:date:message-id:reply-to; bh=XIKxM4CbfYXEhDPGgPcx9yutynDp2j1s3EwU/syUQpQ=; b=Rof1FczkGBIPrVtrYl9aQOVeaGzHmTT0SUIRvTaS9ALzwboR/zFmKa1Ascxov1wEqA NbG6YIf0ASDidyGQk13YZ1sWUWgk+f1sHa0nBOmZARas7GJ7+BDlC4E7KpT1gJp/wdQu jgXYBOkUnsgpJJlMiqnpSW/HGfkmxaMVQVcxHKAdUIInSfsL4IqygEX7DxQldtwZL6wi RxC2bbKaBEAvD5gtPDtHgREAIp5UF0R5vYhgUcaChczWJZZOvN2e9SJPkvAREiwJYLMV 1cTGiSETTP3Cv9OTVVPVBJsxTghfCpt6mf0xZiN47u//UP47IS8EZdeyleS9lXVA3DNR Pu6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690494263; x=1691099063; h=mime-version:message-id:date:references:in-reply-to:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=XIKxM4CbfYXEhDPGgPcx9yutynDp2j1s3EwU/syUQpQ=; b=fQNyU9QaOAhS0LPStMmkzWHZYjXzUuvopljbEUOwLHILftRjFnAXo9PK6jLiRCcb0d 85Zwe4QedcoQ6hRNktTiYM25d966HFD3Z2cQBckXW6Za+9/2bVkplSd3vhNIrci6D6JA gzyAaRpwesFlmn6DFabNnrhSlXVPhjktln4JtVeNSdKWIxj6cXPsR/Ifavx2gEau8NXk pfAx6BVBRM5ff+a0iAKn02viSukbjWKj3Q24Mc6vlYHd0w0VjC+hwKAjJIRFoMVAyico zpt7r2cJG98vZNd8tJZbUyRugjrej5YPzoUb+1j4sc0xlMm/zAfREULxU00f4Iqv954u esbQ== X-Gm-Message-State: ABy/qLauPutHxUELgJbIK+iaZ6OH4xO9UU7h04ZIv7+sSzdL4U8FHHHj RJTF5dMCqMVP7Fhe6HMxlF8= X-Google-Smtp-Source: APBJJlF04aqrTH4Sby6mfxCok+TTmTUZ87WXwvdO55HQ27Vgb9XQ6num+4mJy6Jw8ddiuHAHUsjyxw== X-Received: by 2002:a05:6808:13ca:b0:3a3:78dc:8c4c with SMTP id d10-20020a05680813ca00b003a378dc8c4cmr503596oiw.46.1690494263216; Thu, 27 Jul 2023 14:44:23 -0700 (PDT) Original-Received: from localhost (ip184-189-240-75.sb.sd.cox.net. [184.189.240.75]) by smtp.gmail.com with ESMTPSA id ms19-20020a17090b235300b00263f446d432sm3228894pjb.43.2023.07.27.14.44.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jul 2023 14:44:22 -0700 (PDT) In-Reply-To: <87pm4d12rc.fsf@gmail.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::22d; envelope-from=karthikchikmagalur@gmail.com; helo=mail-oi1-x22d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:308177 Archived-At: > It does not take any longer for the filter function to run on each > invocation. The problem is that The filter in Emacs is called with > about 4KB of new text every time, and these calls are spaced out evenly > in time, so Emacs takes longer to get around to parsing the stdout with > TeXLive 2023. > > The dvisvgm process is thus bottlenecked by Emacs. I can imagine a few > different ways to fix this, but I don't know how to do them: I can confirm this after some benchmarking: | dvisvgm version | Run in shell (s) | Run via Emacs (s) | Difference | |-----------------+------------------+-------------------+------------| | TeXLive 2022 | 1.427 | 1.786 | 25% | | TeXLive 2023 | 1.481 | 2.202 | 48% | The variances are small and have been omitted. So TeXLive 2023's dvisvgm is about 48% slower when called from Emacs because it's waiting on Emacs to pick up the process output. Using a larger stream buffer (if possible) should fix this issue. Karthik