From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Cl=c3=a9ment_Pit-Claudel?= Newsgroups: gmane.emacs.devel Subject: Re: Sv: Emacs HTTP libraries [was: Re: How to contribute new package to GNU ELPA?] Date: Tue, 30 Mar 2021 12:49:25 -0400 Message-ID: <8260671e-df0a-e471-79fb-82f80e11696a@gmail.com> References: <87r1jxd3d8.fsf@gnu.org> <8e549f23-db75-2ef1-4399-0fb52e5efa6f@gnu.org> <87zgykn5qc.fsf@gnus.org> <83sg4ckbfw.fsf@gnu.org> <87mtukn463.fsf@gnus.org> <83o8f0kaoj.fsf@gnu.org> <83mtukk9b3.fsf@gnu.org> <2e968b98-2264-03e7-d0b2-5570c94b6fb7@gmail.com> <838s64k3xk.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21711"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Mar 30 18:53:25 2021 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 1lRHcK-0005Y4-Tz for ged-emacs-devel@m.gmane-mx.org; Tue, 30 Mar 2021 18:53:24 +0200 Original-Received: from localhost ([::1]:51254 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lRHcJ-0005oC-Vd for ged-emacs-devel@m.gmane-mx.org; Tue, 30 Mar 2021 12:53:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58182) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRHYa-0003aj-2S for emacs-devel@gnu.org; Tue, 30 Mar 2021 12:49:33 -0400 Original-Received: from mail-qk1-x731.google.com ([2607:f8b0:4864:20::731]:39521) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lRHYX-0007Z4-2f; Tue, 30 Mar 2021 12:49:31 -0400 Original-Received: by mail-qk1-x731.google.com with SMTP id q26so16511627qkm.6; Tue, 30 Mar 2021 09:49:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:cc:references:from:subject:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=PJIELOGBd1nGt2/A58v/r+Gu+iZ7k9qs3TO8iiF9wak=; b=JCnYF6dP+rTdY/gG2S8o6GoWlST3wSKi5QkkvbPEYc8iw3RLGHv+Cy7WCBnhfUHoDl +OdA0N81UQVL6kPe4KAo4WGoxstWw4U+UiyLCxTjBlIALhrbT2tPInnE29F6F+1+yMwQ UVXuZZ9h5MoHW5sy1OwkiHLQAxWMjSUCsrbNw4jIRB8aPOOLIM7Il/WPQzNdSssgwsY9 k9PgUyF4/HkEOQ07w2ErlXxrWWX4+DROwVhZUbygIjBYTvpKC+m/YQIi0iHo/bZcblh1 9uh/uWZb7RwOQvOcH9lzf4nnOFtyMz/grHM/2dxCmyIPnqfMGZ0Qrlxsmwae0Da2zIU/ qjlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:references:from:subject:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=PJIELOGBd1nGt2/A58v/r+Gu+iZ7k9qs3TO8iiF9wak=; b=jlQsuQGrMm8adS8ZwJ9oUMGG2aHxKj3GYuBqtm/nK8fe/TXuIikQEslsG8tcnQmoDH dxfrodq9moYtZ4yzsPUAfYhkusHFqSVUPysMxET+prKwNJR0M4FZGoGqo61968iEOT6+ 073Nrx+lORLwnTQP14jJQ/A8RRfJfHB1zjyoWGA5qqPxOxdzYBLByrSkdZ+7q8mLvJTT OkT29oWLcCWKYAsVP7jtV6eiJCxV3FbMvl3RJrG8MmZ0JWESmCM8Si25Var2zrKSSAz4 K7sr+QvefpaR5B3Y7vodXkXEFUlOm8zyv3LtUL0vKPYd54ptxOXh+WGexzwEbrsTfjqF RYcw== X-Gm-Message-State: AOAM532wvyfIbnKChOkBfJHc86ztqySd0SlZStkNM0gmw+aFVOiHLtK5 EUA4yzShPJt1SjjsgImVV7iTxymTuYs= X-Google-Smtp-Source: ABdhPJx8/Xoeqash6Lucf98czm4pGKVJJibTdhkWR8nNywDExdoGseQ2VMfCvCDsUJgVni6HPfhnDg== X-Received: by 2002:a37:b103:: with SMTP id a3mr32218152qkf.261.1617122966745; Tue, 30 Mar 2021 09:49:26 -0700 (PDT) Original-Received: from [192.168.1.11] (c-24-61-240-80.hsd1.ma.comcast.net. [24.61.240.80]) by smtp.googlemail.com with ESMTPSA id z6sm13406222qtv.69.2021.03.30.09.49.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 30 Mar 2021 09:49:26 -0700 (PDT) In-Reply-To: <838s64k3xk.fsf@gnu.org> Content-Language: en-GB Received-SPF: pass client-ip=2607:f8b0:4864:20::731; envelope-from=cpitclaudel@gmail.com; helo=mail-qk1-x731.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, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.io gmane.emacs.devel:267186 Archived-At: On 3/30/21 12:21 PM, Eli Zaretskii wrote: >> From: Clément Pit-Claudel >> Date: Tue, 30 Mar 2021 12:13:55 -0400 >> >>> (benchmark-run 1 (url-retrieve-synchronously >>> "https://ftp.gnu.org/gnu/emacs/emacs-27.2.tar.xz")) >>> >>> in Emacs, and compared that with download by wget. On my relatively >>> slow home connection I get almost the same times, down to less than >>> 2%. >> >> On my decently fast home connection, Emacs takes 4.5s-5s to download that file using the form you posted, and wget takes 1.4s-2s to download the same file: >> >> (benchmark-run 1 (url-retrieve-synchronously "https://ftp.gnu.org/gnu/emacs/emacs-27.2.tar.xz")) >> ⇒ (4.875848555 13 3.7572300619999623) > > But note that the actual Emacs download time was 4.876 - 3.757 = 1.319 > sec, the rest was taken by GC. What happens if you set > gc-cons-threshold to a very large value? Good point: (let ((gc-cons-threshold (expt 2 32))) (benchmark-run 1 (url-retrieve-synchronously "https://ftp.gnu.org/gnu/emacs/emacs-27.2.tar.xz"))) ⇒ (3.181631628 0 0.0) ⇒ (1.46930467 0 0.0) > Also, nowadays we have a variable to tune how much stuff do we read in > one go (by default just 4K), so might as well test the effect of that > on download times. You're completely right: (let ((gc-cons-threshold (expt 2 32)) (read-process-output-max (expt 2 22))) (benchmark-run 1 (url-retrieve-synchronously "https://ftp.gnu.org/gnu/emacs/emacs-27.2.tar.xz"))) ⇒ (1.446506607 0 0.0) ⇒ (2.441543274 0 0.0) Adding back GC: (let ((read-process-output-max (expt 2 22))) (benchmark-run 1 (url-retrieve-synchronously "https://ftp.gnu.org/gnu/emacs/emacs-27.2.tar.xz"))) ⇒ (2.719771409 7 1.9299083920000157) Although, to be fair, I'm not sure what to make of these numbers. With the GC change only, for example, Emacs reports 1.45s after freezing for 7 to 8 seconds, not 1.45 — I guess that's because the GC runs after the benchmarking completes? Clément.