From nobody Thu Dec 16 10:53:22 2021 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id BE0B918F1097; Thu, 16 Dec 2021 10:53:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JF89G4khGz4f8s; Thu, 16 Dec 2021 10:53:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 533592E4F2; Thu, 16 Dec 2021 10:53:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1BGArM2W091145; Thu, 16 Dec 2021 10:53:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BGArMnv091144; Thu, 16 Dec 2021 10:53:22 GMT (envelope-from git) Date: Thu, 16 Dec 2021 10:53:22 GMT Message-Id: <202112161053.1BGArMnv091144@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: c5f24f5e0db2 - main - loader: ip: Do not call getsecs so much List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c5f24f5e0db24c8e33e6278a4fbb7e68364ca18d Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1639652003; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l6mRuk/pB8ADyZ3MksLp8HVFwEaxPZNkUo0i//lAiLM=; b=f3FiVWk9tMzahijLgUw0MGpkFTO6ZX36EpvmAvq6AXwj8s3fv343Poon5Vn0ZKsgzk7hsy jv176xXcwpYU6g1AD4glB2TV9Ly5v3OFtLv+H6qsCrme/hbEzmld9pPLqQ3eF+SUQjzbWO tFKYZtbseepWs+uK5+KRrgJ9ojYCivK0afubP6KsmE51EFFm4CQMP1WTKalSRfdGwGJn9y VXdRXwBLABj3G1kXT5BRN9XCuXMfCs6dkKFM354RI7RMsMsEIzbA+anFLXEnRnpkRh9XcJ YksI4o/92z/FkjskXBlRz4JpVJFytxs3Ij4y4q5ID7eOwe05wOBkvVPMlYzvUw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1639652003; a=rsa-sha256; cv=none; b=IFBLufTdpDoJ6PTGvvEPl9QWR5ZEyOqicdwGXuOJx+bVxEzBEXS3arwuh0Qjomiw8ic2UC qM5Fjcs/VJ2mdUmm3xOPOcx7ACSbjhf8ygJyNn8dvu9H85rSHEWN9d/2pByrnT1Qox2OQT tIFKcQFEmDU4PLo2Ck/TWsuE6CZDwcdokQTURZUQT+hsIZR96hSjtuRqkHav02O8wOtH8L 87l6TyrB8j8vvmcw8HHntjXGGLQEw8X5lVebB76rFrF/zBEfsQ0CtAM4xngI3i023h6eoe U3xShLa0BtuZEyZpgw1USW122oVbiax00z+oG0pNKmuFkDdkqDwyVy4KOIUT5Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=c5f24f5e0db24c8e33e6278a4fbb7e68364ca18d commit c5f24f5e0db24c8e33e6278a4fbb7e68364ca18d Author: Emmanuel Vadot AuthorDate: 2021-12-09 14:46:39 +0000 Commit: Emmanuel Vadot CommitDate: 2021-12-16 10:50:36 +0000 loader: ip: Do not call getsecs so much getsecs is very costly, reuse the values we got before. Fetching a ~30MB kernel with the tftp command use to take ~26 seconds and now it's ~18 seconds. Reviewed by: imp, tsoome MFC after: 2 weeks Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D33408 --- stand/libsa/net.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/stand/libsa/net.c b/stand/libsa/net.c index 3142616a5bf0..e04a370e466e 100644 --- a/stand/libsa/net.c +++ b/stand/libsa/net.c @@ -101,10 +101,9 @@ sendrecv(struct iodesc *d, tmo = MINTMO; tlast = 0; tleft = 0; - tref = getsecs(); - t = getsecs(); + tref = t = getsecs(); for (;;) { - if (MAXWAIT > 0 && (getsecs() - tref) >= MAXWAIT) { + if (MAXWAIT > 0 && (t - tref) >= MAXWAIT) { errno = ETIMEDOUT; return -1; }