From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Emacs HTTP libraries [was: Re: How to contribute new package to GNU ELPA?] Date: Tue, 22 Dec 2020 18:02:42 +0200 Message-ID: <83mty5rfq5.fsf@gnu.org> References: <87v9cuf7mg.fsf@posteo.net> 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="3738"; mail-complaints-to="usenet@ciao.gmane.io" Cc: adam@alphapapa.net, rms@gnu.org, arthur.miller@live.com, emacs-devel@gnu.org To: "Philip K." Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Dec 22 17:04:22 2020 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 1krk97-0000pk-OG for ged-emacs-devel@m.gmane-mx.org; Tue, 22 Dec 2020 17:04:21 +0100 Original-Received: from localhost ([::1]:53792 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1krk96-0000Ab-O2 for ged-emacs-devel@m.gmane-mx.org; Tue, 22 Dec 2020 11:04:20 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43430) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1krk7t-0007hB-Gu for emacs-devel@gnu.org; Tue, 22 Dec 2020 11:03:05 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:60575) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1krk7r-0006tL-IE; Tue, 22 Dec 2020 11:03:03 -0500 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3879 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1krk7j-0000on-1F; Tue, 22 Dec 2020 11:02:55 -0500 In-Reply-To: <87v9cuf7mg.fsf@posteo.net> (philipk@posteo.net) 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:261504 Archived-At: > From: "Philip K." > Cc: arthur.miller@live.com, adam@alphapapa.net, rms@gnu.org, > emacs-devel@gnu.org > Date: Tue, 22 Dec 2020 11:38:31 +0100 > > >> In that case, gnutls-negotiate seems to be the most suspicious function, > >> using over 50%-60% of the CPU time, at least on my machine. This also > >> makes sense, as TLS sites seem to take longer to load than regular, > >> non-encrypted ones. > > > > Please show the code you profiled and the fully expanded profile. > > I sadly coudln't reproduce it, but this time the critical section looked > something like this: > > - url-retrieve-synchronously 212 52% > - url-retrieve 149 36% > - url-retrieve-internal 149 36% > - url-http 136 33% > - url-http-find-free-connection 135 33% > - url-open-stream 135 33% > open-network-stream 134 33% > > when evaluating > > (url-retrieve-synchronously "http://textboard.org/sexp/prog/index") > > in the *scratch* buffer. I used emacs -Q (GNU Emacs 27.1 (build 1, > x86_64-redhat-linux-gnu, GTK+ Version 3.24.22, cairo version 1.16.0) of > 2020-08-21), but I don't know why that should make any > difference. I repeated the same test on the master branch and the > results were basically the same (±5%). > > Either way, this simple request took over 2.5 minutes, whereas curl > requires a quarter of a second. Note that this is even unencrypted, so > this is not even taking the encryption overhead into account. That's strange, because I get here much faster times: 0.6 sec (with 3 GC cycles) on the first attempt, and less than 0.1 sec afterwards. How come it's so slow on your system?