home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / x / x11p-13.zip / RCS / x11perf.h,v < prev    next >
Text File  |  1989-12-14  |  10KB  |  371 lines

  1. head     2.5;
  2. access   ;
  3. symbols  pre-merge:2.0;
  4. locks    ; strict;
  5. comment  @ * @;
  6.  
  7.  
  8. 2.5
  9. date     89.12.14.09.46.54;  author joel;  state Exp;
  10. branches ;
  11. next     2.4;
  12.  
  13. 2.4
  14. date     89.12.07.16.44.37;  author joel;  state Exp;
  15. branches ;
  16. next     2.3;
  17.  
  18. 2.3
  19. date     89.05.11.16.42.02;  author joel;  state Exp;
  20. branches ;
  21. next     2.2;
  22.  
  23. 2.2
  24. date     89.05.08.18.39.47;  author joel;  state Exp;
  25. branches ;
  26. next     2.1;
  27.  
  28. 2.1
  29. date     89.05.03.14.18.34;  author joel;  state Exp;
  30. branches ;
  31. next     2.0;
  32.  
  33. 2.0
  34. date     89.01.31.17.08.44;  author erik;  state Exp;
  35. branches ;
  36. next     1.4;
  37.  
  38. 1.4
  39. date     89.01.31.17.08.44;  author joel;  state Exp;
  40. branches ;
  41. next     1.3;
  42.  
  43. 1.3
  44. date     89.01.05.18.29.44;  author joel;  state Exp;
  45. branches ;
  46. next     1.2;
  47.  
  48. 1.2
  49. date     88.12.07.20.41.21;  author joel;  state Exp;
  50. branches ;
  51. next     1.1;
  52.  
  53. 1.1
  54. date     88.06.17.15.06.36;  author joel;  state Exp;
  55. branches ;
  56. next     ;
  57.  
  58.  
  59. desc
  60. @@
  61.  
  62.  
  63. 2.5
  64. log
  65. @Added ``pack'' field, so rects can decide whether to space out rects or not
  66. @
  67. text
  68. @/*****************************************************************************
  69. Copyright 1988, 1989 by Digital Equipment Corporation, Maynard, Massachusetts.
  70.  
  71.                         All Rights Reserved
  72.  
  73. Permission to use, copy, modify, and distribute this software and its 
  74. documentation for any purpose and without fee is hereby granted, 
  75. provided that the above copyright notice appear in all copies and that
  76. both that copyright notice and this permission notice appear in 
  77. supporting documentation, and that the name of Digital not be
  78. used in advertising or publicity pertaining to distribution of the
  79. software without specific, written prior permission.  
  80.  
  81. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  82. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  83. DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  84. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  85. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  86. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  87. SOFTWARE.
  88.  
  89. ******************************************************************************/
  90.  
  91. #ifndef VMS
  92. #include <X11/Xlib.h>
  93. #else
  94. #include <decw$include/Xlib.h>
  95. #endif
  96. #ifndef NULL
  97. #define NULL 0
  98. #endif
  99.  
  100. #define POLY         1000       /* # (small) items in poly calls    */
  101. #define MAXROWS           40       /* Max rows of items in poly calls      */
  102. #define MAXCOLS           25       /* Max columns of items            */
  103.  
  104. #define WIDTH         600    /* Size of large window to work within  */
  105. #define HEIGHT        600
  106.  
  107. #define CHILDSIZE       8       /* Size of children on windowing tests  */
  108. #define CHILDSPACE      4       /* Space between children        */
  109.  
  110. typedef Bool (*InitProc)    (/* XParms xp; Parms p */);
  111. typedef void (*Proc)        (/* XParms xp; Parms p */);
  112.  
  113. extern void NullProc        (/* XParms xp; Parms p */);
  114. extern Bool NullInitProc    (/* XParms xp; Parms p */);
  115.  
  116. typedef struct _Parms {
  117.     /* Required fields */
  118.     int  objects;       /* Number of objects to process in one X call        */
  119.  
  120.     /* Optional fields.  (Wouldn't object-oriented programming be nice ?)   */
  121.     int  special;       /* Usually size of objects to paint            */
  122.     char *font, *bfont;
  123.     int  fillStyle;     /* Solid, transparent stipple, opaque stipple, tile */
  124. } ParmRec, *Parms;
  125.  
  126. typedef struct _XParms {
  127.     Display        *d;
  128.     Window        w;
  129.     GC            fggc;
  130.     GC            bggc;
  131.     unsigned long   foreground;
  132.     unsigned long   background;
  133.     Bool        pack;
  134. } XParmRec, *XParms;
  135.  
  136. typedef enum {
  137.     WINDOW,     /* Windowing test, GXxor has no affect            */
  138.     XOR,    /* Graphics test, GXxor has some affect            */
  139.     NONXOR      /* Graphics or overhead test, GXxor has no affect   */
  140. } TestType;
  141.  
  142. typedef struct _Test {
  143.     char    *option;    /* Name to use in prompt line            */
  144.     char    *label;     /* Fuller description of test            */
  145.     InitProc    init;       /* Initialization procedure                */
  146.     Proc    proc;       /* Timed benchmark procedure            */
  147.     Proc    passCleanup;/* Cleanup between repetitions of same test     */
  148.     Proc    cleanup;    /* Cleanup after test                */
  149.     TestType    testType;   /* Windowing, graphics, nonxor            */
  150.     int        clips;      /* Number of obscuring windows to force clipping*/
  151.     ParmRec     parms;      /* Parameters passed to test procedures        */
  152. } Test;
  153.  
  154. extern Test test[];
  155. extern int subs[];
  156.  
  157. #define ForEachTest(x) for (x = 0; test[x].option != NULL; x++)
  158.  
  159.  
  160. /*****************************************************************************
  161.  
  162. About x11perf:
  163.  
  164. Many graphics benchmarks assume that the graphics device is used to display the
  165. output of a single fancy graphics application, and that the user gets his work
  166. done on some other device, like a terminal.  Such benchmarks usually measure
  167. drawing speed for lines, polygons, text, etc.
  168.  
  169. Since workstations are not used as standalone graphics engines, but as
  170. super-terminals, x11perf measures window management performance as well as
  171. traditional graphics performace.  x11perf includes benchmarks for the time it
  172. takes to create and map windows (as when you start up an application); to map a
  173. pre-existing set of windows onto the screen (as when you deiconify an
  174. application or pop up a menu); and to rearrange windows (as when you slosh
  175. windows to and fro trying to find the one you want).
  176.  
  177. x11perf also measures graphics performance for operations not normally used in
  178. standalone graphics displays, but are nonetheless used frequently by X
  179. applications.  Such operations include CopyPlane (used by the PostScript
  180. previewer), scrolling (used in text windows), and various stipples and tiles
  181. (used for CAD and half-toning, respectively).
  182.  
  183. x11perf DOES NOT attempt to whittle down measurements to a single ``HeXStones''
  184. number.  We consider such numbers to be uninformative at best and misleading at
  185. worst.  x11perf should be used to analyze particular strengths and weaknesses
  186. of servers, and is most useful when used by a server writer who wants to
  187. analyze and improve a server.
  188.  
  189. For repeatable results, x11perf should be run using a local connection on a
  190. freshly-started server.  The default configuration runs each test 5 times, in
  191. order to see if each trial takes approximately the same amount of time.
  192. Strange glitches should be examined; if non-repeatable I chalk them up to
  193. daemons and network traffic.  Each trial is run for 5 seconds, in order to
  194. reduce random time differences.  The number of objects processed per second is
  195. displayed to 3 significant digits, but you'll be lucky on most UNIX system if
  196. the numbers are actually consistent to 2 digits.
  197.  
  198. The current program is mostly the responsibility of Joel McCormack.  It is
  199. based upon the x11perf developed by Phil Karlton, Susan Angebranndt, and Chris
  200. Kent, who wanted to assess performance differences between various servers.
  201. Mary Walker, Todd Newman, and I added several tests in order to write and tune
  202. the pmax (DECStation 3100) servers.  For a general release to the world, I've
  203. basically rewritten x11perf to ease making comparisons between widely varying
  204. machines, to cover most important X functionality (the notable exception being
  205. wide lines), and to exercise graphics operations in as many different
  206. orientations and alignments as possible.
  207.  
  208. ******************************************************************************/
  209. @
  210.  
  211.  
  212. 2.4
  213. log
  214. @Changed interface to p->reps
  215. @
  216. text
  217. @d66 1
  218. @
  219.  
  220.  
  221. 2.3
  222. log
  223. @Parameters to all routines now (xp, p)
  224. MAXROWS used in all routines
  225. Junked most global communication variables
  226. @
  227. text
  228. @d50 5
  229. a54 3
  230.     int  reps;        /* required of all  */
  231.     int  objects;       /* required of all  */
  232.     int  special;
  233. d56 1
  234. a56 1
  235.     int  fillStyle;     /* Solid, transparent stipple, or opqaque stipple? */
  236. d68 6
  237. d75 9
  238. a83 9
  239.     char    *option;    /* Name to use in prompt line                */
  240.     char    *label;     /* Fuller description of test                */
  241.     InitProc init;      /* Initialization procedure                */
  242.     Proc    proc;       /* Timed benchmark procedure                */
  243.     Proc    passCleanup;/* Cleanup between repetitions of same test        */
  244.     Proc    cleanup;    /* Cleanup after test                    */
  245.     Bool    children;   /* Windowing test for differing number of kids?     */
  246.     int     clips;      /* Number of obscuring windows to force clipping    */
  247.     ParmRec parms;      /* Parameters passed to test procedures            */
  248. @
  249.  
  250.  
  251. 2.2
  252. log
  253. @# chars now in x11perf_tests.c table, rather than hardwired constant
  254. @
  255. text
  256. @d1 23
  257. d33 3
  258. a35 2
  259. #define POLY 1000        /* multiple of 25, please        */
  260. #define COLS 25
  261. d37 2
  262. a38 2
  263. #define WIDTH 600        /* Size of large window to work within  */
  264. #define HEIGHT 600
  265. d40 2
  266. a41 2
  267. #define CHILDSIZE     8        /* Size of children on windowing tests  */
  268. #define CHILDSPACE    4        /* Space between children        */
  269. d43 2
  270. a44 2
  271. typedef Bool (*InitProc)    (/* Display *dpy; int numObjects */);
  272. typedef void (*Proc)        (/* Display *dpy; int numObjects */);
  273. d46 2
  274. a47 1
  275. #define NullProc ((Proc)0)
  276. d57 9
  277. a79 1
  278. extern Window root;
  279. a80 2
  280. extern int fgPixel, bgPixel;
  281.  
  282. d83 50
  283. a132 1
  284. extern void CreatePerfStuff(/* dpy, width, height, &w, &bggc, &fggc */);
  285. @
  286.  
  287.  
  288. 2.1
  289. log
  290. @Massive changes, I'm not going to go into details.
  291. @
  292. text
  293. @a10 1
  294. #define CHARS 100        /* length of text strings        */
  295. @
  296.  
  297.  
  298. 2.0
  299. log
  300. @version from /usr/src/pmax
  301. @
  302. text
  303. @d10 2
  304. a11 2
  305. #define POLY 1000        /* multiple of 25, please */
  306. #define CHARS 100        /* length of text strings */
  307. d13 2
  308. a14 1
  309. #define WIDTH 600
  310. d17 2
  311. a18 1
  312. typedef void (*Proc)(/* Display *dpy; int numObjects */);
  313. d20 3
  314. d34 9
  315. a42 9
  316.     char *option;
  317.     char *label;
  318.     Proc init;
  319.     Proc proc;
  320.     Proc passCleanup;
  321.     Proc cleanup;
  322.     Bool children;
  323.     Bool doit;
  324.     ParmRec parms;
  325. @
  326.  
  327.  
  328. 1.4
  329. log
  330. @Added -fg -bg capabilities
  331. @
  332. text
  333. @@
  334.  
  335.  
  336. 1.3
  337. log
  338. @Changed stipple boolean in parameters to fillStyle selection
  339. @
  340. text
  341. @d44 2
  342. d48 1
  343. a48 1
  344. extern void CreatePerfStuff(/* dpy, width, height, &w, &whitegc, &blackgc */);
  345. @
  346.  
  347.  
  348. 1.2
  349. log
  350. @stipple field added to param record
  351. @
  352. text
  353. @d25 1
  354. a25 1
  355.     int  stipple;       /* Do stipple?      */
  356. @
  357.  
  358.  
  359. 1.1
  360. log
  361. @Initial revision
  362. @
  363. text
  364. @d21 3
  365. a23 3
  366.     int reps;            /* required of all */
  367.     int objects;        /* required of all */
  368.     int special;
  369. d25 1
  370. @
  371.