From owner-cvs-all@FreeBSD.ORG Sun Jun 20 21:25:11 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3B0A216A4CE; Sun, 20 Jun 2004 21:25:11 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1DDC243D31; Sun, 20 Jun 2004 21:25:11 +0000 (GMT) (envelope-from gad@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id i5KLPALK072470; Sun, 20 Jun 2004 21:25:10 GMT (envelope-from gad@repoman.freebsd.org) Received: (from gad@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i5KLPAFF072469; Sun, 20 Jun 2004 21:25:10 GMT (envelope-from gad) Message-Id: <200406202125.i5KLPAFF072469@repoman.freebsd.org> From: Garance A Drosehn Date: Sun, 20 Jun 2004 21:25:10 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/bin/ps ps.c ps.h X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2004 21:25:11 -0000 gad 2004-06-20 21:25:10 UTC FreeBSD src repository Modified files: bin/ps ps.c ps.h Log: Have the main() routine calculate %CPU and (if needed) memory information when copying per-process info before starting to sort the list. This way, sort-by-CPU or sort-by-memory will only calculate values once-per-process, instead of twice-per-comparison. Also take advantage of this to simplify the pscomp() routine. Revision Changes Path 1.99 +29 -36 src/bin/ps/ps.c 1.18 +2 -0 src/bin/ps/ps.h