2
The BENCH program benchmarks and tests Gist
4
$Id: README.B 685 2003-03-08 15:26:51Z travo $
6
The execute line for the program is
8
bench [useps [host:server.screen]]
10
where useps is 0 (the default) to use a CGM file as the hardcopy
11
device, and 1 to use a PostScript file. If the optional X display
12
argument is not given, the Gist default is to use the DISPLAY
13
environment variable, like other X programs. (If you built bench
14
with NO_XLIB, both arguments are ignored-- the "display" device is
15
a CGM file, and the hardcopy device is a PostScript file.) The
16
output files, if any, will be "bench.ps" for PostScript output,
17
and "bench.cgm" for CGM output. (Gist automatically families large
18
CGM files to about 1 Meg per file, so check for "benci.cgm",
19
"bencj.cgm", etc. The gist CGM browser automatically jumps
20
between files in a family.)
22
The program waits for you to type a command, then exercises the
23
specified feature of Gist. Some of the commands merely set attributes
24
rather than producing any graphics output. Some commands add a
25
graphical element to the current drawing; others produce movies
26
to get an idea of Gist performance during animation. Most commands
27
test the `D' and `H' level routines, but a few `A' and `P' level
28
benchmarks allow you to see how much performance penalty is incurred
29
by the higher level routines. These low level tests also provide
30
fair comparisons of Gist with other graphics packages.
32
The 'help' command produces the following output, describing the
36
Initializing 51x51 contour function, STANDBY... DONE
39
This is the GIST benchmark/test program, commands are:
41
Movies to test low level Gist functions--
42
0 - raw performance test GaMesh (direct)
43
1 - raw performance test GaMesh (animated)
44
2 - raw performance test GaFillMesh (direct)
45
3 - raw performance test GaFillMesh (animated)
46
clr - toggle interframe clear for tests 0-3
48
im - raw performance test GpCells
49
clip - toggle floating point clip
50
zoom - toggle zoom for 0-3, im, pli
52
Property toggles for high level tests--
53
bnd - mesh boundary odd0 - mesh region to 0
54
odd2 - mesh region to 2 reg0 - plot region to 0
55
reg1 - plot region to 1 reg2 - plot region to 2
56
nocopy - toggle noCopy mode for mesh-based tests
57
cmode - toggle dumping of colormap in hcp file
58
earth - use earthtones palette (default). Others are:
59
stern rainbow heat gray yarg
60
work - use work stylesheet (default). Others are:
62
wide - toggle wide lines in all line drawings
63
linetype - cycle through 5 line types in all line drawings
64
closed - toggle closed lines in plg tests
65
rays - toggle ray arrows in plg tests
66
smooth - cycle through 3 hcp smoothnesses in plg tests
67
limits, xmin, xmax, ymin, ymax, nice=1/0, square=1/0,
68
restrict=1/0 - set limits (default limits,e,e,e,e)
69
logxy, 1/0, 1/0 - set/reset log scaling for x,y axes
70
animate - toggle animation mode
71
marks - toggle occasional curve markers for line drawings
72
legends - toggle dumping of legends into hcp file
74
Movies to test high level Gist functions--
81
Single frame tests of high level Gist functions--
84
plf1 - test GdFillMesh
85
plc1 - test GdContours
88
pls - test GdLines in polymarker mode
89
pldj - test GdDisjoint
90
txin - test GdText txout - 2nd test of GdText
91
calib - text calibration frame
92
cfont - toggle font for calibration frame
94
Tests of high level Gist control functions--
96
hcp - send current frame to hardcopy file
97
hcpon - send every frame to hardcopy file
98
hcpoff - stop sending every frame to hardcopy file
99
redraw - redraw the X window
101
quit - exit bench program (just q works too)
106
Here are 3 sample sessions with the bench program. Input lines that you
107
type are marked with bench>. Most of the features of Gist are
108
demonstrated here. The three sessions are:
109
(1) A performance test, both for "fastest possible" rendering using
110
A-level and P-level Gist routines, and for the D-level display
111
list routines that could reasonably be used by an interpreter.
112
Gist's "animation" mode is exhibited (smooth animation requires
113
a picture to be built up offscreen, then "blitted" onscreen).
114
The polyline and filled area primitives are exercised.
115
(2) Generate a relatively small CGM file which contains nearly
116
everything that Gist will ever throw at a CGM interpreter.
117
This file is useful for exercising the gist CGM browser, as well
118
as for seeing how badly Gist CGM file break your second favorite
120
(3) Exercise other high level features of Gist, especially the
121
tick drawing and labeling routine. Also exhibits D-level style
124
For the record, "miggle" is a Sun-4/330 running the X11R4 sample server
125
from MIT. Gist was compiled by gcc with no optimization (optimization
126
speeds up the low level benchmarks by about 30%). The display is to
127
an HP 730 workstation, which has a very fast X server.
130
(1)---------------------------------------------------------------------
133
IMPORTANT-- If you care about the timings in the first test, be sure
134
to clear all other jobs off of the machine which is running your
135
X server, AND DON'T MOVE THE MOUSE OR TYPE DURING A TEST!
138
Initializing 51x51 contour function, STANDBY... DONE
140
Begin benchmark 0 -- GaMesh (direct).
141
elapsed seconds: 3.370000 user, 0.710000 system, 13.409998 wall
142
Plots per wall second= 3.728561
145
Begin benchmark 1 -- GaMesh (animated).
146
elapsed seconds: 3.210000 user, 0.820000 system, 15.399998 wall
147
Plots per wall second= 3.246754
150
Begin benchmark 2 -- GaFillMesh (direct).
151
elapsed seconds: 9.770000 user, 2.260000 system, 36.759997 wall
152
Plots per wall second= 1.360174
155
Begin benchmark 3 -- GaFillMesh (animated).
156
elapsed seconds: 9.790000 user, 2.380000 system, 22.969997 wall
157
Plots per wall second= 2.176753
160
Toggle floating point clip (now on)
163
Begin benchmark 0 -- GaMesh (direct).
164
elapsed seconds: 4.870000 user, 0.780000 system, 15.829997 wall
165
Plots per wall second= 3.158560
168
Begin benchmark 1 -- GaMesh (animated).
169
elapsed seconds: 5.010000 user, 0.630000 system, 15.849998 wall
170
Plots per wall second= 3.154575
173
Begin benchmark 2 -- GaFillMesh (direct).
174
elapsed seconds: 13.390000 user, 2.410000 system, 40.499997 wall
175
Plots per wall second= 1.234568
178
Begin benchmark 3 -- GaFillMesh (animated).
179
elapsed seconds: 13.570000 user, 2.330000 system, 28.999997 wall
180
Plots per wall second= 1.724138
186
Begin mesh benchmark.
187
elapsed seconds: 6.940000 user, 0.820000 system, 15.439997 wall
188
Plots per wall second= 3.238343
191
Toggle animation mode (now on)
194
Begin mesh benchmark.
195
elapsed seconds: 7.000000 user, 0.710000 system, 17.179998 wall
196
Plots per wall second= 2.910361
199
Toggle animation mode (now off)
202
Begin filled mesh benchmark.
203
elapsed seconds: 19.500000 user, 2.180000 system, 37.429997 wall
204
Plots per wall second= 1.335827
207
Toggle animation mode (now on)
210
Begin filled mesh benchmark.
211
elapsed seconds: 19.230000 user, 2.320000 system, 37.099997 wall
212
Plots per wall second= 1.347709
215
120.5u 18.8s 7:42 30% 0+568k 1+1io 1pf+0w
217
Several features of these benchmark results are worth contemplating:
218
Most important, for the X Engine (at least on my Sun-4/330), the time
219
is dominated by the rendering time of the server, NOT by the CPU time
220
required by Gist. Secondly, of the CPU time used by Gist, the time to
221
do the floating point clip explains much of the additional time used
222
by the Gist D-level routines (there is no very practical way to avoid
223
the clipping operation in the D-level routines). Thirdly, animation
224
mode costs little in performance.
227
(2)---------------------------------------------------------------------
229
Generate a CGM test file for exercising the gist browser:
232
Initializing 51x51 contour function, STANDBY... DONE
237
Toggle markers (now on)
243
Toggle markers (now off)
252
Toggle rays (now off)
255
Toggle wide lines (now on)
261
Toggle line type (now dashed)
267
Toggle line type (now dotted)
273
Toggle line type (now dash-dot)
279
Toggle line type (now dash-dot-dot)
285
Toggle line type (now solid)
288
Toggle wide lines (now off)
294
Toggle line type (now dashed)
300
Toggle line type (now dotted)
306
Toggle line type (now dash-dot)
312
Toggle line type (now dash-dot-dot)
318
Toggle line type (now solid)
357
Toggle hcp color mode (now dump)
414
miggle[53] mv bench.cgm check.cgm
418
Repeat this test with the command line "bench 1" to generate a PostScript
419
file which you can send to your printer to be sure that Gist doesn't
420
produce anything which confuses it. Alternatively, you can build the
421
gist previewer and run check.cgm through it to convert to PostScript:
423
miggle[54] gist/gist check.cgm -b -ps check.ps
425
Or view the CGM file on your X server:
427
miggle[55] gist/gist check.cgm
428
check.cgm metafile description:
429
Fri Oct 30 13:53:07 1992; For: munro
439
You can also compare the relative sizes of PostScript and CGM output.
440
On a more extensive test, I found that:
442
(1) A Gist PostScript file is roughly twice the size of the Gist CGM
443
file produced by the same commands (two hex characters represent
445
(2) The CPU time required by Gist to produce a PostScript file is two
446
to three times the CPU time required by Gist to produce a CGM file
447
from the same commands.
448
(3) The compress utility will squeeze the PostScript file by about 60%,
449
to a size just slightly smaller than the CGM file. The CGM file
450
compresses only 10-15% (not worth doing, but slightly smaller than
451
the compressed PostScript).
453
The moral is- use Gist CGM output and don't bother to compress it. The
454
gist CGM browser will translate Gist CGM files into exactly the same
455
PostScript file Gist would have produced in the first place.
458
(3)---------------------------------------------------------------------
460
The plg, plm, plc, plv, plf, plt, and pli commands to bench test
461
features of the proposed interactive interface routines of the
462
same names described in README. The fma, redraw, limits, and
463
logxy commands are also similar to the proposed interface, except
464
that the limits command in bench takes the logarithms of the
465
limits, while the interactive routine would work in the intuitive
468
Whenever the screen looks interesting, type "hcp" to send it to the
469
CGM file "bench.ps", which you can send to your printer. (Note-
470
this will fail silently for the frame displayed at the end of any
471
of the movies, or for the "stale" frame displayed after fma.)
475
Initializing 51x51 contour function, STANDBY... DONE
503
bench> limits, .02, 1.48, .31, .59
506
bench> limits, -.2, 1.2, e, e
509
bench> limits, -.2, e, e, e, square=1
512
bench> limits, -.2, 1.5, e, e
515
bench> limits, square=0
521
bench> limits, 105, 190, -.001, 1
524
bench> limits, 17, 39.5, .001, .1
527
bench> limits, 17, 32, 1, 100
530
bench> limits, 16, 19, 1.e4, 1.e6
536
bench> limits, e, e, e, e
541
elapsed seconds: 2.410000 user, 0.180000 system, 2.839997 wall
542
Plots per wall second= 17.605653
545
Toggle animation mode (now on)
549
elapsed seconds: 2.320000 user, 0.150000 system, 4.079997 wall
550
Plots per wall second= 12.254911
553
Toggle markers (now on)
557
elapsed seconds: 3.170000 user, 0.280000 system, 4.389997 wall
558
Plots per wall second= 11.389529
561
Toggle wide lines (now on)
563
bench> limits, square=1
567
Toggle markers (now off)
571
elapsed seconds: 2.260000 user, 0.160000 system, 5.779997 wall
572
Plots per wall second= 8.650523
575
Toggle wide lines (now off)
582
elapsed seconds: 3.090000 user, 0.270000 system, 3.409997 wall
583
Plots per wall second= 14.662770
586
Toggle rays (now off)
588
bench> limits, square=0
592
Begin mesh benchmark.
593
elapsed seconds: 6.930000 user, 0.830000 system, 16.279997 wall
594
Plots per wall second= 3.071254
597
Toggle markers (now on)
600
Begin contour benchmark.
601
elapsed seconds: 15.810000 user, 0.310000 system, 16.179997 wall
602
Plots per wall second= 3.090235
604
bench> limits, .25, .75, .25, .75
608
Begin vector benchmark.
609
elapsed seconds: 12.650000 user, 0.860000 system, 14.929997 wall
610
Plots per wall second= 3.348963
613
Toggle animation mode (now off)
615
bench> limits, e, e, e, e
628
Toggle hcp color mode (now dump)
697
55.9u 4.1s 9:32 10% 0+736k 6+1io 6pf+0w
699
Note that in non-dump cmode, a redraw is required after a palette change
700
to change the pixel numbers of the image.