From owner-freebsd-bugs Wed Jul 17 18:50:29 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5185837B400 for ; Wed, 17 Jul 2002 18:50:02 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 98E2143E65 for ; Wed, 17 Jul 2002 18:50:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.4/8.12.4) with ESMTP id g6I1o1JU013940 for ; Wed, 17 Jul 2002 18:50:01 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.4/8.12.4/Submit) id g6I1o1N6013939; Wed, 17 Jul 2002 18:50:01 -0700 (PDT) Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2CB8537B400 for ; Wed, 17 Jul 2002 18:44:03 -0700 (PDT) Received: from www.freebsd.org (www.FreeBSD.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id DF9E443E31 for ; Wed, 17 Jul 2002 18:44:02 -0700 (PDT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.12.4/8.12.4) with ESMTP id g6I1i2OT096589 for ; Wed, 17 Jul 2002 18:44:02 -0700 (PDT) (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.12.4/8.12.4/Submit) id g6I1i25M096588; Wed, 17 Jul 2002 18:44:02 -0700 (PDT) Message-Id: <200207180144.g6I1i25M096588@www.freebsd.org> Date: Wed, 17 Jul 2002 18:44:02 -0700 (PDT) From: Si-Liang Chang To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: kern/40714: Functions with more than 1 arguments Gets More Executing Time. Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 40714 >Category: kern >Synopsis: Functions with more than 1 arguments Gets More Executing Time. >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: wish >Submitter-Id: current-users >Arrival-Date: Wed Jul 17 18:50:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Si-Liang Chang >Release: 4.6-Release >Organization: Institute of Physics, National Chiao-Tung Univ., Taiwan, R.O.C >Environment: FreeBSD orchid 4.6-RELEASE FreeBSD 4.6-RELEASE #0: Tue Jun 11 06:14:12 GMT 2002 murray@builder.freebsdmall.com:/usr/src/sys/compile/GENERIC i386 >Description: When running my molecule dynamics simulation programs on FreeBSD, they are always about 33% slower than those (with the same conditions) run on a Linux box or Solaris. In order to simplify the problem, we run several testing programs. Finally, we conclude that, functions with more than 1 arguments spend much executing time. >How-To-Repeat: In Program 1, it spends about 7.534u on our PPro FreeBSD 4.6R mechine. In Program 2, it spends about 2.904u on our PPro FreeBSD 4.6R mechine. In the meanwhile, In Program 1, it spends about 2.56u on our PPro Solaris 8 mechine. In Program 2, it spends about 2.66u on our PPro Solaris 8 mechine. Of course, the problem exist for mechines with higher speed such as AMD XP 1G and XP+ 1.8G. Program 1------------------------------ #include double Fun(double,double,double); int main(void) { double x,y,z,s; s=0.0; for(x=0.0;x<1.0;x=x+0.001) { for(y=0.0;y<1.0;y=y+0.001) { for(z=0.0;z<1.0;z=z+0.1) { s=Fun(x,y,z); } } } } double Fun(double x,double y,double z) { return(x+y+z); } Program 2 --------------------------------- #include double Fun(double); int main(void) { double x,y,z,s; s=0.0; for(x=0.0;x<1.0;x=x+0.001) { for(y=0.0;y<1.0;y=y+0.001) { for(z=0.0;z<1.0;z=z+0.1) { s=Fun(x)+Fun(y)+Fun(z); } } } } double Fun(double x) { return(x+1.0); } >Fix: >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message