From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96078694111424.tru64-unix-managers.marc@archive.invalid> From: Allen David Winter Date: Wed, 18 Feb 1998 20:55:38 +0000 To: tru64-unix-managers Subject: Followup: Improving Graphics Performance X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96078694111424 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--y3jFeOvsjN" --y3jFeOvsjN Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit A followup to yesterday's question about improving graphics performance on DEC Personal Workstations, especially as compared to Sun Ultras. Workstation details: EV56 433MHz DEC Personal Workstation 2MB L3 cache 128MB RAM, 300MB swap 4D20 24-plane graphics card The application: Attached is the benchmark (C source code) with instructions in the comments. The goal: I am interested in finding ways of increasing the "frames/second" rate of this benchmark, or in why this runs so much faster on Sun Ultras. The benchmark should complete in only a few seconds. Any information in this area would be greatly appreciated. I'll summarize the runs (non-DEC gladly accepted). -Allen Winter, winter@clark.net --y3jFeOvsjN Content-Type: text/plain Content-Description: frame-rate benchmark Content-Disposition: inline; filename="frame-rate-test.c" Content-Transfer-Encoding: 7bit #define CODE_VERSION "FRAME RATE TEST v1.O" #define CODE_DATE "12 January 1998" /*************************************************** The experiment: Please time (/usr/bin/time will do) two different experiments for each platform, namely frame-rate-test 176 144 1000 #height=176, width=144, frames=1000 frame-rate-test 352 288 1000 #height=352, width=288, frames=1000 If you have a library that would improve the performance of this function, please run it with and without this library, reporting the results in each case. Send your times to Allen Winter, winterz@clark.net */ /*************************************************** A Simple X-Windows based frame rate tester. Essentially a 24 bit Window is created along with a 24bit ZPixmap XImage. Then the image is sent, via XPutImage to the screen a specified number of times. The intent of this is to calculate a frame rate given the number of frames and wall clock time. FPS = (#Frames)/(WallClock); Assumptions are made in this code (ie 24bit) which was intended to eliminate the entire dither process. In addition, there is some 1-time overhead at the beginning to create the image buffer, but this shouldn't detract from the test. BUILD: (with whatever flavor of cc, and the desired Xlib): cc frame-rate-test.c -o frame-rate-test -lXll USAGE: frame-rate-test ****************************************************************************/ /* standard include */ #include #include /* XWindows Headers */ #include #include void print_version(char *execname) { fprintf(stderr,"exec : %s\nver : %s\ndate : %s\n", execname,CODE_VERSION,CODE_DATE); } Display *display; /* X Display */ Window win; /* X Window */ GC gc; /* Graphics Context for the Image */ XVisualInfo vinfo; /* Visual Information */ XEvent event; /* Xevent */ int screen; /* Screen number */ /* prototype */ #ifdef __STDC__ int initialize_Xll(int image_width,int image_height); #else int initialize_Xll(); #endif /******************************************************************* Main *******************************************************/ int main (int argc, char *argv[]) { XImage *ximage; /* Pointer to the XImage structure */ unsigned int *image; /* Actual 24Bit image */ int image_width; /* Width of the Image */ int image_height; /* Height of the image */ int num_runs; /* Number of frames to put out */ int i; /* counter */ int total_pixels; /* Total number of pixels in image */ int middle; /* Middle of the image */ /* check the command line */ if((argc==1)||(argc<4)) { fprintf(stderr,"usage : %s \n",argv[0]); print_version(argv[0]); return(-1); } /* read in the command line args */ sscanf(argv[1],"%d",&image_height); sscanf(argv[2],"%d",&image_width); sscanf(argv[3],"%d",&num_runs); if((image_height<0)||(image_width<0)||(num_runs<0)) { fprintf(stderr,"usage : %s \n",argv[0]); return(-1); } /* compute the number of pixels */ total_pixels = image_height*image_width; middle = total_pixels/2; /* malloc space for the image */ if((image=(unsigned int *) malloc(sizeof(unsigned int)*(total_pixels)))==NULL) { fprintf(stderr,"%s : Malloc error\n",argv[0]); return(-1); } /* Set up the Xll and Windowing Stuff */ if(initialize_Xll(image_width,image_height)<0) return(-1); /* zero the image data */ for(i=0;i