From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 65F6B3858C83 for ; Mon, 7 Feb 2022 10:27:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 65F6B3858C83 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-283-IA72Gq_GPY6-gbI0GVERWg-1; Mon, 07 Feb 2022 05:27:14 -0500 X-MC-Unique: IA72Gq_GPY6-gbI0GVERWg-1 Received: by mail-wm1-f72.google.com with SMTP id 130-20020a1c0288000000b0037bc5cbd027so1845985wmc.8 for ; Mon, 07 Feb 2022 02:27:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=E5lXlH4lDSaVbzluD1ZcheZiVG0pCV4xgGWoCNDcAjY=; b=bes9bRpPQxkcgGkiQM1WTz2axm9AuEL1T3Izkt8XyOuQeohDh0CJ8sAfFRnhCWCaP/ c2hbCGQUTS5O7IboW2a+ruF5n0aDrFA+Uy+Qei9uC7zAuJdxHSzqnAcye/3hRV6pYgBe NBiWeVFQuYjxmHeyHcyJheCVhg0luQ3iDVAwnPQcd1wQK3mVPPvojKt3QwfNje0+yXAD LV3ocV01antm7g1eDKy1Ftj+HA/yNt5l/R8cBBqNJSgcW64vWn6WTgWTaDgByjDCuN3H 7ov46zkpPH7Y1SaCGocLu23eAWCE8vZ+Ge1ZIA/LvURDRKH2bG5f1oUDnDpiPduo9Nqq PfDw== X-Gm-Message-State: AOAM533mdfI92FhHM1vcughLQA6uf979Vra2M46x98WKX0EIuzJaND9e iHZALXtacgF9GB+gTouFvI8cEte+NrxF6tJwQDZDatPIwoWdvypLhznWgFaaAj6iIKwgColqBiB UuClV96TohXEYZJpE/boFxmccaYuKp39jyNrJqPG4+Fv+Tm8EMsuxzuHt8nOOa+QL3JpSDzoktg == X-Received: by 2002:a7b:c350:: with SMTP id l16mr10142419wmj.146.1644229633368; Mon, 07 Feb 2022 02:27:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJw4kKXSiH7dh8YBR1h4rYXF+0ErysKBHPYLyZNVlp+qMLREwNFOeSOZutJ6J9opPH82fut0Rg== X-Received: by 2002:a7b:c350:: with SMTP id l16mr10142401wmj.146.1644229633078; Mon, 07 Feb 2022 02:27:13 -0800 (PST) Received: from localhost (host86-134-151-224.range86-134.btcentralplus.com. [86.134.151.224]) by smtp.gmail.com with ESMTPSA id t14sm17508827wmq.43.2022.02.07.02.27.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Feb 2022 02:27:12 -0800 (PST) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Subject: Re: [PATCH] gdb: unbuffer all input streams when not using readline In-Reply-To: <20220202162317.GI425591@redhat.com> References: <20220117164051.1854133-1-aburgess@redhat.com> <20220202162317.GI425591@redhat.com> Date: Mon, 07 Feb 2022 10:27:11 +0000 Message-ID: <877da79dkw.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Feb 2022 10:27:17 -0000 Andrew Burgess writes: > * Simon Marchi via Gdb-patches [2022-01-18 11:26:42 -0500]: > >> >> The change looks ok to me (better than the status quo), given that >> correctness is more important than performance. >> >> I'm just wondering if there's a noticeable performance difference >> between having the input buffered vs unbuffered. Calling fgetc with >> unbuffered input means we do one syscall per character. With frontends >> sending tons of commands, it could possibly affect the responsiveness >> and degrade user experience. But it's just a guess, we should be able >> to measure it. > > I'm planning to go ahead and push this patch - I'll give it a couple > more days in case someone wants to shout stop! > > On input performance: > > - I tested this and was a <1% slow down, which seem acceptable to > me, > > - I notice that readline reads its input one character at a time > too, so now our non-readline input is handled the same way, > > - This function is not used for reading commands from a file (I did > a simple test, and didn't hit this function), so shouldn't impact > that case at all. > > On output performance: > > - The unbuffering will only impact the output file descriptor for > the new-ui case, usually, in all other cases, in and out are > separate file descriptors, > > - The new-ui command only really makes sense for spinning up mi > interpreters, > > - The mi interpreter buffers its output in string_files (see > mi/mi-out.c), and then writes the output in a single command, so > we shouldn't see any change in performance. > > As this patch fixes a real bug, I think, lets merge this now, and if > there's any issues later, we can figure out what to do then. I've now pushed this patch. Thanks, Andrew