/share/doc/papers/sysperf/appendix.ms

https://bitbucket.org/freebsd/freebsd-head/ · Unknown · 1040 lines · 958 code · 82 blank · 0 comment · 0 complexity · ddbcbd24fd1cb4b652268dde5568ac08 MD5 · raw file

  1. .\" $FreeBSD$
  2. .am vS
  3. ..
  4. .am vE
  5. ..
  6. 'ss 23
  7. 'ds _ \d\(mi\u
  8. 'ps 9z
  9. 'vs 10p
  10. 'ds - \(mi
  11. 'ds / \\h'\\w' 'u-\\w'/'u'/
  12. 'ds /* \\h'\\w' 'u-\\w'/'u'/*
  13. 'bd B 3
  14. 'bd S B 3
  15. 'nr cm 0
  16. 'nf
  17. 'de vH
  18. 'ev 2
  19. 'ft 1
  20. 'sp .35i
  21. 'tl '\s14\f3\\*(=F\fP\s0'\\*(=H'\f3\s14\\*(=F\fP\s0'
  22. 'sp .25i
  23. 'ft 1
  24. \f2\s12\h'\\n(.lu-\w'\\*(=f'u'\\*(=f\fP\s0\h'|0u'
  25. .sp .05i
  26. 'ev
  27. 'ds =G \\*(=F
  28. ..
  29. 'de vF
  30. 'ev 2
  31. 'sp .35i
  32. 'ie o 'tl '\f2\\*(=M''Page % of \\*(=G\fP'
  33. 'el 'tl '\f2Page % of \\*(=G''\\*(=M\fP'
  34. 'bp
  35. 'ev
  36. 'ft 1
  37. 'if \\n(cm=1 'ft 2
  38. ..
  39. 'de ()
  40. 'pn 1
  41. ..
  42. 'de +C
  43. 'nr cm 1
  44. 'ft 2
  45. 'ds +K
  46. 'ds -K
  47. ..
  48. 'de -C
  49. 'nr cm 0
  50. 'ft 1
  51. 'ds +K \f3
  52. 'ds -K \fP
  53. ..
  54. '+C
  55. '-C
  56. 'am +C
  57. 'ne 3
  58. ..
  59. 'de FN
  60. \f2\s14\h'\\n(.lu-\w'\\$1'u'\\$1\fP\s0\h'|0u'\c
  61. .if r x .if \\nx .if d =F .tm \\$1 \\*(=F \\n%
  62. 'ds =f \&...\\$1
  63. ..
  64. 'de FC
  65. .if r x .if \\nx .if d =F .tm \\$1 \\*(=F \\n%
  66. 'ds =f \&...\\$1
  67. ..
  68. 'de -F
  69. 'rm =f
  70. ..
  71. 'ft 1
  72. 'lg 0
  73. '-F
  74. .\" Copyright (c) 1985 The Regents of the University of California.
  75. .\" All rights reserved.
  76. .\"
  77. .\" Redistribution and use in source and binary forms, with or without
  78. .\" modification, are permitted provided that the following conditions
  79. .\" are met:
  80. .\" 1. Redistributions of source code must retain the above copyright
  81. .\" notice, this list of conditions and the following disclaimer.
  82. .\" 2. Redistributions in binary form must reproduce the above copyright
  83. .\" notice, this list of conditions and the following disclaimer in the
  84. .\" documentation and/or other materials provided with the distribution.
  85. .\" 3. All advertising materials mentioning features or use of this software
  86. .\" must display the following acknowledgement:
  87. .\" This product includes software developed by the University of
  88. .\" California, Berkeley and its contributors.
  89. .\" 4. Neither the name of the University nor the names of its contributors
  90. .\" may be used to endorse or promote products derived from this software
  91. .\" without specific prior written permission.
  92. .\"
  93. .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  94. .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  95. .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  96. .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  97. .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  98. .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  99. .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  100. .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  101. .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  102. .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  103. .\" SUCH DAMAGE.
  104. .\"
  105. .\" @(#)a1.t 5.1 (Berkeley) 4/17/91
  106. .\"
  107. .ds RH Appendix A \- Benchmark sources
  108. .nr H2 1
  109. .sp 2
  110. .de vS
  111. .nf
  112. ..
  113. .de vE
  114. .fi
  115. ..
  116. .bp
  117. .SH
  118. \s+2Appendix A \- Benchmark sources\s-2
  119. .LP
  120. The programs shown here run under 4.2 with only routines
  121. from the standard libraries. When run under 4.1 they were augmented
  122. with a \fIgetpagesize\fP routine and a copy of the \fIrandom\fP
  123. function from the C library. The \fIvforks\fP and \fIvexecs\fP
  124. programs are constructed from the \fIforks\fP and \fIexecs\fP programs,
  125. respectively, by substituting calls to \fIfork\fP with calls to
  126. \fIvfork\fP.
  127. .SH
  128. syscall
  129. .LP
  130. .vS
  131. \fI\h'\w' 'u-\w'/'u'/\fP\fI*\fP\c\c
  132. '+C
  133. \fI*\fP System call overhead benchmark\&.
  134. \fI*\fP\fI\h'\w' 'u-\w'/'u'/\fP\c
  135. '-C
  136. 'FN main
  137. main(argc, argv)
  138. \h'|11n'\*(+Kchar\*(-K \fI*\fPargv[];
  139. \*(+K{\*(-K
  140. \h'|11n'\*(+Kregister\*(-K \*(+Kint\*(-K ncalls;
  141. \h'|11n'\*(+Kif\*(-K (argc < 2) \*(+K{\*(-K
  142. \h'|21n'printf("usage: %s #syscalls\en", argv[0]);
  143. \h'|21n'exit(1);
  144. \h'|11n'\*(+K}\*(-K
  145. \h'|11n'ncalls = atoi(argv[1]);
  146. \h'|11n'\*(+Kwhile\*(-K (ncalls\*-\*- > 0)
  147. \h'|21n'(\*(+Kvoid\*(-K) getpid();
  148. \*(+K}\*(-K\c\c
  149. '-F
  150. .vE
  151. .SH
  152. csw
  153. .LP
  154. .vS
  155. \fI\h'\w' 'u-\w'/'u'/\fP\fI*\fP\c\c
  156. '+C
  157. \fI*\fP Context switching benchmark\&.
  158. \fI*\fP
  159. \fI*\fP Force system to context switch 2\fI*\fPnsigs
  160. \fI*\fP times by forking and exchanging signals\&.
  161. \fI*\fP To calculate system overhead for a context
  162. \fI*\fP switch, the signocsw program must be run
  163. \fI*\fP with nsigs\&. Overhead is then estimated by
  164. \fI*\fP\h'|11n't1 = time csw <n>
  165. \fI*\fP\h'|11n't2 = time signocsw <n>
  166. \fI*\fP\h'|11n'overhead = t1 \*- 2 \fI*\fP t2;
  167. \fI*\fP\fI\h'\w' 'u-\w'/'u'/\fP\c
  168. '-C
  169. \*(+K#include\*(-K <signal\&.h>
  170. \*(+Kint\*(-K\h'|11n'sigsub();
  171. \*(+Kint\*(-K\h'|11n'otherpid;
  172. \*(+Kint\*(-K\h'|11n'nsigs;
  173. 'FN main
  174. main(argc, argv)
  175. \h'|11n'\*(+Kchar\*(-K \fI*\fPargv[];
  176. \*(+K{\*(-K
  177. \h'|11n'\*(+Kint\*(-K pid;
  178. \h'|11n'\*(+Kif\*(-K (argc < 2) \*(+K{\*(-K
  179. \h'|21n'printf("usage: %s nsignals\en", argv[0]);
  180. \h'|21n'exit(1);
  181. \h'|11n'\*(+K}\*(-K
  182. \h'|11n'nsigs = atoi(argv[1]);
  183. \h'|11n'signal(SIGALRM, sigsub);
  184. \h'|11n'otherpid = getpid();
  185. \h'|11n'pid = fork();
  186. \h'|11n'\*(+Kif\*(-K (pid != 0) \*(+K{\*(-K
  187. \h'|21n'otherpid = pid;
  188. \h'|21n'kill(otherpid, SIGALRM);
  189. \h'|11n'\*(+K}\*(-K
  190. \h'|11n'\*(+Kfor\*(-K (;;)
  191. \h'|21n'sigpause(0);
  192. \*(+K}\*(-K\c\c
  193. '-F
  194. 'FN sigsub
  195. sigsub()
  196. \*(+K{\*(-K
  197. \h'|11n'signal(SIGALRM, sigsub);
  198. \h'|11n'kill(otherpid, SIGALRM);
  199. \h'|11n'\*(+Kif\*(-K (\*-\*-nsigs <= 0)
  200. \h'|21n'exit(0);
  201. \*(+K}\*(-K\c\c
  202. '-F
  203. .vE
  204. .SH
  205. signocsw
  206. .LP
  207. .vS
  208. \fI\h'\w' 'u-\w'/'u'/\fP\fI*\fP\c\c
  209. '+C
  210. \fI*\fP Signal without context switch benchmark\&.
  211. \fI*\fP\fI\h'\w' 'u-\w'/'u'/\fP\c
  212. '-C
  213. \*(+K#include\*(-K <signal\&.h>
  214. \*(+Kint\*(-K\h'|11n'pid;
  215. \*(+Kint\*(-K\h'|11n'nsigs;
  216. \*(+Kint\*(-K\h'|11n'sigsub();
  217. 'FN main
  218. main(argc, argv)
  219. \h'|11n'\*(+Kchar\*(-K \fI*\fPargv[];
  220. \*(+K{\*(-K
  221. \h'|11n'\*(+Kregister\*(-K \*(+Kint\*(-K i;
  222. \h'|11n'\*(+Kif\*(-K (argc < 2) \*(+K{\*(-K
  223. \h'|21n'printf("usage: %s nsignals\en", argv[0]);
  224. \h'|21n'exit(1);
  225. \h'|11n'\*(+K}\*(-K
  226. \h'|11n'nsigs = atoi(argv[1]);
  227. \h'|11n'signal(SIGALRM, sigsub);
  228. \h'|11n'pid = getpid();
  229. \h'|11n'\*(+Kfor\*(-K (i = 0; i < nsigs; i++)
  230. \h'|21n'kill(pid, SIGALRM);
  231. \*(+K}\*(-K\c\c
  232. '-F
  233. 'FN sigsub
  234. sigsub()
  235. \*(+K{\*(-K
  236. \h'|11n'signal(SIGALRM, sigsub);
  237. \*(+K}\*(-K\c\c
  238. '-F
  239. .vE
  240. .SH
  241. pipeself
  242. .LP
  243. .vS
  244. \fI\h'\w' 'u-\w'/'u'/\fP\fI*\fP\c\c
  245. '+C
  246. \fI*\fP IPC benchmark,
  247. \fI*\fP write to self using pipes\&.
  248. \fI*\fP\fI\h'\w' 'u-\w'/'u'/\fP\c
  249. '-C
  250. 'FN main
  251. main(argc, argv)
  252. \h'|11n'\*(+Kchar\*(-K \fI*\fPargv[];
  253. \*(+K{\*(-K
  254. \h'|11n'\*(+Kchar\*(-K buf[512];
  255. \h'|11n'\*(+Kint\*(-K fd[2], msgsize;
  256. \h'|11n'\*(+Kregister\*(-K \*(+Kint\*(-K i, iter;
  257. \h'|11n'\*(+Kif\*(-K (argc < 3) \*(+K{\*(-K
  258. \h'|21n'printf("usage: %s iterations message\*-size\en", argv[0]);
  259. \h'|21n'exit(1);
  260. \h'|11n'\*(+K}\*(-K
  261. \h'|11n'argc\*-\*-, argv++;
  262. \h'|11n'iter = atoi(\fI*\fPargv);
  263. \h'|11n'argc\*-\*-, argv++;
  264. \h'|11n'msgsize = atoi(\fI*\fPargv);
  265. \h'|11n'\*(+Kif\*(-K (msgsize > \*(+Ksizeof\*(-K (buf) || msgsize <= 0) \*(+K{\*(-K
  266. \h'|21n'printf("%s: Bad message size\&.\en", \fI*\fPargv);
  267. \h'|21n'exit(2);
  268. \h'|11n'\*(+K}\*(-K
  269. \h'|11n'\*(+Kif\*(-K (pipe(fd) < 0) \*(+K{\*(-K
  270. \h'|21n'perror("pipe");
  271. \h'|21n'exit(3);
  272. \h'|11n'\*(+K}\*(-K
  273. \h'|11n'\*(+Kfor\*(-K (i = 0; i < iter; i++) \*(+K{\*(-K
  274. \h'|21n'write(fd[1], buf, msgsize);
  275. \h'|21n'read(fd[0], buf, msgsize);
  276. \h'|11n'\*(+K}\*(-K
  277. \*(+K}\*(-K\c\c
  278. '-F
  279. .vE
  280. .SH
  281. pipediscard
  282. .LP
  283. .vS
  284. \fI\h'\w' 'u-\w'/'u'/\fP\fI*\fP\c\c
  285. '+C
  286. \fI*\fP IPC benchmarkl,
  287. \fI*\fP write and discard using pipes\&.
  288. \fI*\fP\fI\h'\w' 'u-\w'/'u'/\fP\c
  289. '-C
  290. 'FN main
  291. main(argc, argv)
  292. \h'|11n'\*(+Kchar\*(-K \fI*\fPargv[];
  293. \*(+K{\*(-K
  294. \h'|11n'\*(+Kchar\*(-K buf[512];
  295. \h'|11n'\*(+Kint\*(-K fd[2], msgsize;
  296. \h'|11n'\*(+Kregister\*(-K \*(+Kint\*(-K i, iter;
  297. \h'|11n'\*(+Kif\*(-K (argc < 3) \*(+K{\*(-K
  298. \h'|21n'printf("usage: %s iterations message\*-size\en", argv[0]);
  299. \h'|21n'exit(1);
  300. \h'|11n'\*(+K}\*(-K
  301. \h'|11n'argc\*-\*-, argv++;
  302. \h'|11n'iter = atoi(\fI*\fPargv);
  303. \h'|11n'argc\*-\*-, argv++;
  304. \h'|11n'msgsize = atoi(\fI*\fPargv);
  305. \h'|11n'\*(+Kif\*(-K (msgsize > \*(+Ksizeof\*(-K (buf) || msgsize <= 0) \*(+K{\*(-K
  306. \h'|21n'printf("%s: Bad message size\&.\en", \fI*\fPargv);
  307. \h'|21n'exit(2);
  308. \h'|11n'\*(+K}\*(-K
  309. \h'|11n'\*(+Kif\*(-K (pipe(fd) < 0) \*(+K{\*(-K
  310. \h'|21n'perror("pipe");
  311. \h'|21n'exit(3);
  312. \h'|11n'\*(+K}\*(-K
  313. \h'|11n'\*(+Kif\*(-K (fork() == 0)
  314. \h'|21n'\*(+Kfor\*(-K (i = 0; i < iter; i++)
  315. \h'|31n'read(fd[0], buf, msgsize);
  316. \h'|11n'\*(+Kelse\*(-K
  317. \h'|21n'\*(+Kfor\*(-K (i = 0; i < iter; i++)
  318. \h'|31n'write(fd[1], buf, msgsize);
  319. \*(+K}\*(-K\c\c
  320. '-F
  321. .vE
  322. .SH
  323. pipeback
  324. .LP
  325. .vS
  326. \fI\h'\w' 'u-\w'/'u'/\fP\fI*\fP\c\c
  327. '+C
  328. \fI*\fP IPC benchmark,
  329. \fI*\fP read and reply using pipes\&.
  330. \fI*\fP
  331. \fI*\fP Process forks and exchanges messages
  332. \fI*\fP over a pipe in a request\*-response fashion\&.
  333. \fI*\fP\fI\h'\w' 'u-\w'/'u'/\fP\c
  334. '-C
  335. 'FN main
  336. main(argc, argv)
  337. \h'|11n'\*(+Kchar\*(-K \fI*\fPargv[];
  338. \*(+K{\*(-K
  339. \h'|11n'\*(+Kchar\*(-K buf[512];
  340. \h'|11n'\*(+Kint\*(-K fd[2], fd2[2], msgsize;
  341. \h'|11n'\*(+Kregister\*(-K \*(+Kint\*(-K i, iter;
  342. \h'|11n'\*(+Kif\*(-K (argc < 3) \*(+K{\*(-K
  343. \h'|21n'printf("usage: %s iterations message\*-size\en", argv[0]);
  344. \h'|21n'exit(1);
  345. \h'|11n'\*(+K}\*(-K
  346. \h'|11n'argc\*-\*-, argv++;
  347. \h'|11n'iter = atoi(\fI*\fPargv);
  348. \h'|11n'argc\*-\*-, argv++;
  349. \h'|11n'msgsize = atoi(\fI*\fPargv);
  350. \h'|11n'\*(+Kif\*(-K (msgsize > \*(+Ksizeof\*(-K (buf) || msgsize <= 0) \*(+K{\*(-K
  351. \h'|21n'printf("%s: Bad message size\&.\en", \fI*\fPargv);
  352. \h'|21n'exit(2);
  353. \h'|11n'\*(+K}\*(-K
  354. \h'|11n'\*(+Kif\*(-K (pipe(fd) < 0) \*(+K{\*(-K
  355. \h'|21n'perror("pipe");
  356. \h'|21n'exit(3);
  357. \h'|11n'\*(+K}\*(-K
  358. \h'|11n'\*(+Kif\*(-K (pipe(fd2) < 0) \*(+K{\*(-K
  359. \h'|21n'perror("pipe");
  360. \h'|21n'exit(3);
  361. \h'|11n'\*(+K}\*(-K
  362. \h'|11n'\*(+Kif\*(-K (fork() == 0)
  363. \h'|21n'\*(+Kfor\*(-K (i = 0; i < iter; i++) \*(+K{\*(-K
  364. \h'|31n'read(fd[0], buf, msgsize);
  365. \h'|31n'write(fd2[1], buf, msgsize);
  366. \h'|21n'\*(+K}\*(-K
  367. \h'|11n'\*(+Kelse\*(-K
  368. \h'|21n'\*(+Kfor\*(-K (i = 0; i < iter; i++) \*(+K{\*(-K
  369. \h'|31n'write(fd[1], buf, msgsize);
  370. \h'|31n'read(fd2[0], buf, msgsize);
  371. \h'|21n'\*(+K}\*(-K
  372. \*(+K}\*(-K\c\c
  373. '-F
  374. .vE
  375. .SH
  376. forks
  377. .LP
  378. .vS
  379. \fI\h'\w' 'u-\w'/'u'/\fP\fI*\fP\c\c
  380. '+C
  381. \fI*\fP Benchmark program to calculate fork+wait
  382. \fI*\fP overhead (approximately)\&. Process
  383. \fI*\fP forks and exits while parent waits\&.
  384. \fI*\fP The time to run this program is used
  385. \fI*\fP in calculating exec overhead\&.
  386. \fI*\fP\fI\h'\w' 'u-\w'/'u'/\fP\c
  387. '-C
  388. 'FN main
  389. main(argc, argv)
  390. \h'|11n'\*(+Kchar\*(-K \fI*\fPargv[];
  391. \*(+K{\*(-K
  392. \h'|11n'\*(+Kregister\*(-K \*(+Kint\*(-K nforks, i;
  393. \h'|11n'\*(+Kchar\*(-K \fI*\fPcp;
  394. \h'|11n'\*(+Kint\*(-K pid, child, status, brksize;
  395. \h'|11n'\*(+Kif\*(-K (argc < 2) \*(+K{\*(-K
  396. \h'|21n'printf("usage: %s number\*-of\*-forks sbrk\*-size\en", argv[0]);
  397. \h'|21n'exit(1);
  398. \h'|11n'\*(+K}\*(-K
  399. \h'|11n'nforks = atoi(argv[1]);
  400. \h'|11n'\*(+Kif\*(-K (nforks < 0) \*(+K{\*(-K
  401. \h'|21n'printf("%s: bad number of forks\en", argv[1]);
  402. \h'|21n'exit(2);
  403. \h'|11n'\*(+K}\*(-K
  404. \h'|11n'brksize = atoi(argv[2]);
  405. \h'|11n'\*(+Kif\*(-K (brksize < 0) \*(+K{\*(-K
  406. \h'|21n'printf("%s: bad size to sbrk\en", argv[2]);
  407. \h'|21n'exit(3);
  408. \h'|11n'\*(+K}\*(-K
  409. \h'|11n'cp = (\*(+Kchar\*(-K \fI*\fP)sbrk(brksize);
  410. \h'|11n'\*(+Kif\*(-K ((\*(+Kint\*(-K)cp == \*-1) \*(+K{\*(-K
  411. \h'|21n'perror("sbrk");
  412. \h'|21n'exit(4);
  413. \h'|11n'\*(+K}\*(-K
  414. \h'|11n'\*(+Kfor\*(-K (i = 0; i < brksize; i += 1024)
  415. \h'|21n'cp[i] = i;
  416. \h'|11n'\*(+Kwhile\*(-K (nforks\*-\*- > 0) \*(+K{\*(-K
  417. \h'|21n'child = fork();
  418. \h'|21n'\*(+Kif\*(-K (child == \*-1) \*(+K{\*(-K
  419. \h'|31n'perror("fork");
  420. \h'|31n'exit(\*-1);
  421. \h'|21n'\*(+K}\*(-K
  422. \h'|21n'\*(+Kif\*(-K (child == 0)
  423. \h'|31n'\*_exit(\*-1);
  424. \h'|21n'\*(+Kwhile\*(-K ((pid = wait(&status)) != \*-1 && pid != child)
  425. \h'|31n';
  426. \h'|11n'\*(+K}\*(-K
  427. \h'|11n'exit(0);
  428. \*(+K}\*(-K\c\c
  429. '-F
  430. .vE
  431. .SH
  432. execs
  433. .LP
  434. .vS
  435. \fI\h'\w' 'u-\w'/'u'/\fP\fI*\fP\c\c
  436. '+C
  437. \fI*\fP Benchmark program to calculate exec
  438. \fI*\fP overhead (approximately)\&. Process
  439. \fI*\fP forks and execs "null" test program\&.
  440. \fI*\fP The time to run the fork program should
  441. \fI*\fP then be deducted from this one to
  442. \fI*\fP estimate the overhead for the exec\&.
  443. \fI*\fP\fI\h'\w' 'u-\w'/'u'/\fP\c
  444. '-C
  445. 'FN main
  446. main(argc, argv)
  447. \h'|11n'\*(+Kchar\*(-K \fI*\fPargv[];
  448. \*(+K{\*(-K
  449. \h'|11n'\*(+Kregister\*(-K \*(+Kint\*(-K nexecs, i;
  450. \h'|11n'\*(+Kchar\*(-K \fI*\fPcp, \fI*\fPsbrk();
  451. \h'|11n'\*(+Kint\*(-K pid, child, status, brksize;
  452. \h'|11n'\*(+Kif\*(-K (argc < 3) \*(+K{\*(-K
  453. \h'|21n'printf("usage: %s number\*-of\*-execs sbrk\*-size job\*-name\en",
  454. \h'|21n' argv[0]);
  455. \h'|21n'exit(1);
  456. \h'|11n'\*(+K}\*(-K
  457. \h'|11n'nexecs = atoi(argv[1]);
  458. \h'|11n'\*(+Kif\*(-K (nexecs < 0) \*(+K{\*(-K
  459. \h'|21n'printf("%s: bad number of execs\en", argv[1]);
  460. \h'|21n'exit(2);
  461. \h'|11n'\*(+K}\*(-K
  462. \h'|11n'brksize = atoi(argv[2]);
  463. \h'|11n'\*(+Kif\*(-K (brksize < 0) \*(+K{\*(-K
  464. \h'|21n'printf("%s: bad size to sbrk\en", argv[2]);
  465. \h'|21n'exit(3);
  466. \h'|11n'\*(+K}\*(-K
  467. \h'|11n'cp = sbrk(brksize);
  468. \h'|11n'\*(+Kif\*(-K ((\*(+Kint\*(-K)cp == \*-1) \*(+K{\*(-K
  469. \h'|21n'perror("sbrk");
  470. \h'|21n'exit(4);
  471. \h'|11n'\*(+K}\*(-K
  472. \h'|11n'\*(+Kfor\*(-K (i = 0; i < brksize; i += 1024)
  473. \h'|21n'cp[i] = i;
  474. \h'|11n'\*(+Kwhile\*(-K (nexecs\*-\*- > 0) \*(+K{\*(-K
  475. \h'|21n'child = fork();
  476. \h'|21n'\*(+Kif\*(-K (child == \*-1) \*(+K{\*(-K
  477. \h'|31n'perror("fork");
  478. \h'|31n'exit(\*-1);
  479. \h'|21n'\*(+K}\*(-K
  480. \h'|21n'\*(+Kif\*(-K (child == 0) \*(+K{\*(-K
  481. \h'|31n'execv(argv[3], argv);
  482. \h'|31n'perror("execv");
  483. \h'|31n'\*_exit(\*-1);
  484. \h'|21n'\*(+K}\*(-K
  485. \h'|21n'\*(+Kwhile\*(-K ((pid = wait(&status)) != \*-1 && pid != child)
  486. \h'|31n';
  487. \h'|11n'\*(+K}\*(-K
  488. \h'|11n'exit(0);
  489. \*(+K}\*(-K\c\c
  490. '-F
  491. .vE
  492. .SH
  493. nulljob
  494. .LP
  495. .vS
  496. \fI\h'\w' 'u-\w'/'u'/\fP\fI*\fP\c\c
  497. '+C
  498. \fI*\fP Benchmark "null job" program\&.
  499. \fI*\fP\fI\h'\w' 'u-\w'/'u'/\fP\c
  500. '-C
  501. 'FN main
  502. main(argc, argv)
  503. \h'|11n'\*(+Kchar\*(-K \fI*\fPargv[];
  504. \*(+K{\*(-K
  505. \h'|11n'exit(0);
  506. \*(+K}\*(-K\c\c
  507. '-F
  508. .vE
  509. .SH
  510. bigjob
  511. .LP
  512. .vS
  513. \fI\h'\w' 'u-\w'/'u'/\fP\fI*\fP\c\c
  514. '+C
  515. \fI*\fP Benchmark "null big job" program\&.
  516. \fI*\fP\fI\h'\w' 'u-\w'/'u'/\fP\c
  517. '-C
  518. \fI\h'\w' 'u-\w'/'u'/\fP\fI*\fP\c\c
  519. '+C
  520. 250 here is intended to approximate vi\'s text+data size \fI*\fP\fI\h'\w' 'u-\w'/'u'/\fP\c
  521. '-C
  522. \*(+Kchar\*(-K\h'|11n'space[1024 \fI*\fP 250] = "force into data segment";
  523. 'FN main
  524. main(argc, argv)
  525. \h'|11n'\*(+Kchar\*(-K \fI*\fPargv[];
  526. \*(+K{\*(-K
  527. \h'|11n'exit(0);
  528. \*(+K}\*(-K\c\c
  529. '-F
  530. .vE
  531. .bp
  532. .SH
  533. seqpage
  534. .LP
  535. .vS
  536. \fI\h'\w' 'u-\w'/'u'/\fP\fI*\fP\c\c
  537. '+C
  538. \fI*\fP Sequential page access benchmark\&.
  539. \fI*\fP\fI\h'\w' 'u-\w'/'u'/\fP\c
  540. '-C
  541. \*(+K#include\*(-K <sys\fI\h'\w' 'u-\w'/'u'/\fPvadvise\&.h>
  542. \*(+Kchar\*(-K\h'|11n'\fI*\fPvalloc();
  543. 'FN main
  544. main(argc, argv)
  545. \h'|11n'\*(+Kchar\*(-K \fI*\fPargv[];
  546. \*(+K{\*(-K
  547. \h'|11n'\*(+Kregister\*(-K i, niter;
  548. \h'|11n'\*(+Kregister\*(-K \*(+Kchar\*(-K \fI*\fPpf, \fI*\fPlastpage;
  549. \h'|11n'\*(+Kint\*(-K npages = 4096, pagesize, vflag = 0;
  550. \h'|11n'\*(+Kchar\*(-K \fI*\fPpages, \fI*\fPname;
  551. \h'|11n'name = argv[0];
  552. \h'|11n'argc\*-\*-, argv++;
  553. again:
  554. \h'|11n'\*(+Kif\*(-K (argc < 1) \*(+K{\*(-K
  555. usage:
  556. \h'|21n'printf("usage: %s [ \*-v ] [ \*-p #pages ] niter\en", name);
  557. \h'|21n'exit(1);
  558. \h'|11n'\*(+K}\*(-K
  559. \h'|11n'\*(+Kif\*(-K (strcmp(\fI*\fPargv, "\*-p") == 0) \*(+K{\*(-K
  560. \h'|21n'argc\*-\*-, argv++;
  561. \h'|21n'\*(+Kif\*(-K (argc < 1)
  562. \h'|31n'\*(+Kgoto\*(-K usage;
  563. \h'|21n'npages = atoi(\fI*\fPargv);
  564. \h'|21n'\*(+Kif\*(-K (npages <= 0) \*(+K{\*(-K
  565. \h'|31n'printf("%s: Bad page count\&.\en", \fI*\fPargv);
  566. \h'|31n'exit(2);
  567. \h'|21n'\*(+K}\*(-K
  568. \h'|21n'argc\*-\*-, argv++;
  569. \h'|21n'\*(+Kgoto\*(-K again;
  570. \h'|11n'\*(+K}\*(-K
  571. \h'|11n'\*(+Kif\*(-K (strcmp(\fI*\fPargv, "\*-v") == 0) \*(+K{\*(-K
  572. \h'|21n'argc\*-\*-, argv++;
  573. \h'|21n'vflag++;
  574. \h'|21n'\*(+Kgoto\*(-K again;
  575. \h'|11n'\*(+K}\*(-K
  576. \h'|11n'niter = atoi(\fI*\fPargv);
  577. \h'|11n'pagesize = getpagesize();
  578. \h'|11n'pages = valloc(npages \fI*\fP pagesize);
  579. \h'|11n'\*(+Kif\*(-K (pages == (\*(+Kchar\*(-K \fI*\fP)0) \*(+K{\*(-K
  580. \h'|21n'printf("Can\'t allocate %d pages (%2\&.1f megabytes)\&.\en",
  581. \h'|21n' npages, (npages \fI*\fP pagesize) \fI\h'\w' 'u-\w'/'u'/\fP (1024\&. \fI*\fP 1024\&.));
  582. \h'|21n'exit(3);
  583. \h'|11n'\*(+K}\*(-K
  584. \h'|11n'lastpage = pages + (npages \fI*\fP pagesize);
  585. \h'|11n'\*(+Kif\*(-K (vflag)
  586. \h'|21n'vadvise(VA\*_SEQL);
  587. \h'|11n'\*(+Kfor\*(-K (i = 0; i < niter; i++)
  588. \h'|21n'\*(+Kfor\*(-K (pf = pages; pf < lastpage; pf += pagesize)
  589. \h'|31n'\fI*\fPpf = 1;
  590. \*(+K}\*(-K\c\c
  591. '-F
  592. .vE
  593. .SH
  594. randpage
  595. .LP
  596. .vS
  597. \fI\h'\w' 'u-\w'/'u'/\fP\fI*\fP\c\c
  598. '+C
  599. \fI*\fP Random page access benchmark\&.
  600. \fI*\fP\fI\h'\w' 'u-\w'/'u'/\fP\c
  601. '-C
  602. \*(+K#include\*(-K <sys\fI\h'\w' 'u-\w'/'u'/\fPvadvise\&.h>
  603. \*(+Kchar\*(-K\h'|11n'\fI*\fPvalloc();
  604. \*(+Kint\*(-K\h'|11n'rand();
  605. 'FN main
  606. main(argc, argv)
  607. \h'|11n'\*(+Kchar\*(-K \fI*\fPargv[];
  608. \*(+K{\*(-K
  609. \h'|11n'\*(+Kregister\*(-K \*(+Kint\*(-K npages = 4096, pagesize, pn, i, niter;
  610. \h'|11n'\*(+Kint\*(-K vflag = 0, debug = 0;
  611. \h'|11n'\*(+Kchar\*(-K \fI*\fPpages, \fI*\fPname;
  612. \h'|11n'name = argv[0];
  613. \h'|11n'argc\*-\*-, argv++;
  614. again:
  615. \h'|11n'\*(+Kif\*(-K (argc < 1) \*(+K{\*(-K
  616. usage:
  617. \h'|21n'printf("usage: %s [ \*-d ] [ \*-v ] [ \*-p #pages ] niter\en", name);
  618. \h'|21n'exit(1);
  619. \h'|11n'\*(+K}\*(-K
  620. \h'|11n'\*(+Kif\*(-K (strcmp(\fI*\fPargv, "\*-p") == 0) \*(+K{\*(-K
  621. \h'|21n'argc\*-\*-, argv++;
  622. \h'|21n'\*(+Kif\*(-K (argc < 1)
  623. \h'|31n'\*(+Kgoto\*(-K usage;
  624. \h'|21n'npages = atoi(\fI*\fPargv);
  625. \h'|21n'\*(+Kif\*(-K (npages <= 0) \*(+K{\*(-K
  626. \h'|31n'printf("%s: Bad page count\&.\en", \fI*\fPargv);
  627. \h'|31n'exit(2);
  628. \h'|21n'\*(+K}\*(-K
  629. \h'|21n'argc\*-\*-, argv++;
  630. \h'|21n'\*(+Kgoto\*(-K again;
  631. \h'|11n'\*(+K}\*(-K
  632. \h'|11n'\*(+Kif\*(-K (strcmp(\fI*\fPargv, "\*-v") == 0) \*(+K{\*(-K
  633. \h'|21n'argc\*-\*-, argv++;
  634. \h'|21n'vflag++;
  635. \h'|21n'\*(+Kgoto\*(-K again;
  636. \h'|11n'\*(+K}\*(-K
  637. \h'|11n'\*(+Kif\*(-K (strcmp(\fI*\fPargv, "\*-d") == 0) \*(+K{\*(-K
  638. \h'|21n'argc\*-\*-, argv++;
  639. \h'|21n'debug++;
  640. \h'|21n'\*(+Kgoto\*(-K again;
  641. \h'|11n'\*(+K}\*(-K
  642. \h'|11n'niter = atoi(\fI*\fPargv);
  643. \h'|11n'pagesize = getpagesize();
  644. \h'|11n'pages = valloc(npages \fI*\fP pagesize);
  645. \h'|11n'\*(+Kif\*(-K (pages == (\*(+Kchar\*(-K \fI*\fP)0) \*(+K{\*(-K
  646. \h'|21n'printf("Can\'t allocate %d pages (%2\&.1f megabytes)\&.\en",
  647. \h'|21n' npages, (npages \fI*\fP pagesize) \fI\h'\w' 'u-\w'/'u'/\fP (1024\&. \fI*\fP 1024\&.));
  648. \h'|21n'exit(3);
  649. \h'|11n'\*(+K}\*(-K
  650. \h'|11n'\*(+Kif\*(-K (vflag)
  651. \h'|21n'vadvise(VA\*_ANOM);
  652. \h'|11n'\*(+Kfor\*(-K (i = 0; i < niter; i++) \*(+K{\*(-K
  653. \h'|21n'pn = random() % npages;
  654. \h'|21n'\*(+Kif\*(-K (debug)
  655. \h'|31n'printf("touch page %d\en", pn);
  656. \h'|21n'pages[pagesize \fI*\fP pn] = 1;
  657. \h'|11n'\*(+K}\*(-K
  658. \*(+K}\*(-K\c\c
  659. '-F
  660. .vE
  661. .SH
  662. gausspage
  663. .LP
  664. .vS
  665. \fI\h'\w' 'u-\w'/'u'/\fP\fI*\fP\c\c
  666. '+C
  667. \fI*\fP Random page access with
  668. \fI*\fP a gaussian distribution\&.
  669. \fI*\fP
  670. \fI*\fP Allocate a large (zero fill on demand) address
  671. \fI*\fP space and fault the pages in a random gaussian
  672. \fI*\fP order\&.
  673. \fI*\fP\fI\h'\w' 'u-\w'/'u'/\fP\c
  674. '-C
  675. \*(+Kfloat\*(-K\h'|11n'sqrt(), log(), rnd(), cos(), gauss();
  676. \*(+Kchar\*(-K\h'|11n'\fI*\fPvalloc();
  677. \*(+Kint\*(-K\h'|11n'rand();
  678. 'FN main
  679. main(argc, argv)
  680. \h'|11n'\*(+Kchar\*(-K \fI*\fPargv[];
  681. \*(+K{\*(-K
  682. \h'|11n'\*(+Kregister\*(-K \*(+Kint\*(-K pn, i, niter, delta;
  683. \h'|11n'\*(+Kregister\*(-K \*(+Kchar\*(-K \fI*\fPpages;
  684. \h'|11n'\*(+Kfloat\*(-K sd = 10\&.0;
  685. \h'|11n'\*(+Kint\*(-K npages = 4096, pagesize, debug = 0;
  686. \h'|11n'\*(+Kchar\*(-K \fI*\fPname;
  687. \h'|11n'name = argv[0];
  688. \h'|11n'argc\*-\*-, argv++;
  689. again:
  690. \h'|11n'\*(+Kif\*(-K (argc < 1) \*(+K{\*(-K
  691. usage:
  692. \h'|21n'printf(
  693. "usage: %s [ \*-d ] [ \*-p #pages ] [ \*-s standard\*-deviation ] iterations\en", name);
  694. \h'|21n'exit(1);
  695. \h'|11n'\*(+K}\*(-K
  696. \h'|11n'\*(+Kif\*(-K (strcmp(\fI*\fPargv, "\*-s") == 0) \*(+K{\*(-K
  697. \h'|21n'argc\*-\*-, argv++;
  698. \h'|21n'\*(+Kif\*(-K (argc < 1)
  699. \h'|31n'\*(+Kgoto\*(-K usage;
  700. \h'|21n'sscanf(\fI*\fPargv, "%f", &sd);
  701. \h'|21n'\*(+Kif\*(-K (sd <= 0) \*(+K{\*(-K
  702. \h'|31n'printf("%s: Bad standard deviation\&.\en", \fI*\fPargv);
  703. \h'|31n'exit(2);
  704. \h'|21n'\*(+K}\*(-K
  705. \h'|21n'argc\*-\*-, argv++;
  706. \h'|21n'\*(+Kgoto\*(-K again;
  707. \h'|11n'\*(+K}\*(-K
  708. \h'|11n'\*(+Kif\*(-K (strcmp(\fI*\fPargv, "\*-p") == 0) \*(+K{\*(-K
  709. \h'|21n'argc\*-\*-, argv++;
  710. \h'|21n'\*(+Kif\*(-K (argc < 1)
  711. \h'|31n'\*(+Kgoto\*(-K usage;
  712. \h'|21n'npages = atoi(\fI*\fPargv);
  713. \h'|21n'\*(+Kif\*(-K (npages <= 0) \*(+K{\*(-K
  714. \h'|31n'printf("%s: Bad page count\&.\en", \fI*\fPargv);
  715. \h'|31n'exit(2);
  716. \h'|21n'\*(+K}\*(-K
  717. \h'|21n'argc\*-\*-, argv++;
  718. \h'|21n'\*(+Kgoto\*(-K again;
  719. \h'|11n'\*(+K}\*(-K
  720. \h'|11n'\*(+Kif\*(-K (strcmp(\fI*\fPargv, "\*-d") == 0) \*(+K{\*(-K
  721. \h'|21n'argc\*-\*-, argv++;
  722. \h'|21n'debug++;
  723. \h'|21n'\*(+Kgoto\*(-K again;
  724. \h'|11n'\*(+K}\*(-K
  725. \h'|11n'niter = atoi(\fI*\fPargv);
  726. \h'|11n'pagesize = getpagesize();
  727. \h'|11n'pages = valloc(npages\fI*\fPpagesize);
  728. \h'|11n'\*(+Kif\*(-K (pages == (\*(+Kchar\*(-K \fI*\fP)0) \*(+K{\*(-K
  729. \h'|21n'printf("Can\'t allocate %d pages (%2\&.1f megabytes)\&.\en",
  730. \h'|21n' npages, (npages\fI*\fPpagesize) \fI\h'\w' 'u-\w'/'u'/\fP (1024\&. \fI*\fP 1024\&.));
  731. \h'|21n'exit(3);
  732. \h'|11n'\*(+K}\*(-K
  733. \h'|11n'pn = 0;
  734. \h'|11n'\*(+Kfor\*(-K (i = 0; i < niter; i++) \*(+K{\*(-K
  735. \h'|21n'delta = gauss(sd, 0\&.0);
  736. \h'|21n'\*(+Kwhile\*(-K (pn + delta < 0 || pn + delta > npages)
  737. \h'|31n'delta = gauss(sd, 0\&.0);
  738. \h'|21n'pn += delta;
  739. \h'|21n'\*(+Kif\*(-K (debug)
  740. \h'|31n'printf("touch page %d\en", pn);
  741. \h'|21n'\*(+Kelse\*(-K
  742. \h'|31n'pages[pn \fI*\fP pagesize] = 1;
  743. \h'|11n'\*(+K}\*(-K
  744. \*(+K}\*(-K\c\c
  745. '-F
  746. \*(+Kfloat\*(-K
  747. 'FN gauss
  748. gauss(sd, mean)
  749. \h'|11n'\*(+Kfloat\*(-K sd, mean;
  750. \*(+K{\*(-K
  751. \h'|11n'\*(+Kregister\*(-K \*(+Kfloat\*(-K qa, qb;
  752. \h'|11n'qa = sqrt(log(rnd()) \fI*\fP \*-2\&.0);
  753. \h'|11n'qb = 3\&.14159 \fI*\fP rnd();
  754. \h'|11n'\*(+Kreturn\*(-K (qa \fI*\fP cos(qb) \fI*\fP sd + mean);
  755. \*(+K}\*(-K\c\c
  756. '-F
  757. \*(+Kfloat\*(-K
  758. 'FN rnd
  759. rnd()
  760. \*(+K{\*(-K
  761. \h'|11n'\*(+Kstatic\*(-K \*(+Kint\*(-K seed = 1;
  762. \h'|11n'\*(+Kstatic\*(-K \*(+Kint\*(-K biggest = 0x7fffffff;
  763. \h'|11n'\*(+Kreturn\*(-K ((\*(+Kfloat\*(-K)rand(seed) \fI\h'\w' 'u-\w'/'u'/\fP (\*(+Kfloat\*(-K)biggest);
  764. \*(+K}\*(-K\c\c
  765. '-F
  766. .vE
  767. '-F
  768. .\" $FreeBSD$
  769. .am vS
  770. ..
  771. .am vE
  772. ..
  773. 'ss 23
  774. 'ds _ \d\(mi\u
  775. 'ps 9z
  776. 'vs 10p
  777. 'ds - \(mi
  778. 'ds / \\h'\\w' 'u-\\w'/'u'/
  779. 'ds /* \\h'\\w' 'u-\\w'/'u'/*
  780. 'bd B 3
  781. 'bd S B 3
  782. 'nr cm 0
  783. 'nf
  784. 'de vH
  785. 'ev 2
  786. 'ft 1
  787. 'sp .35i
  788. 'tl '\s14\f3\\*(=F\fP\s0'\\*(=H'\f3\s14\\*(=F\fP\s0'
  789. 'sp .25i
  790. 'ft 1
  791. \f2\s12\h'\\n(.lu-\w'\\*(=f'u'\\*(=f\fP\s0\h'|0u'
  792. .sp .05i
  793. 'ev
  794. 'ds =G \\*(=F
  795. ..
  796. 'de vF
  797. 'ev 2
  798. 'sp .35i
  799. 'ie o 'tl '\f2\\*(=M''Page % of \\*(=G\fP'
  800. 'el 'tl '\f2Page % of \\*(=G''\\*(=M\fP'
  801. 'bp
  802. 'ev
  803. 'ft 1
  804. 'if \\n(cm=1 'ft 2
  805. ..
  806. 'de ()
  807. 'pn 1
  808. ..
  809. 'de +C
  810. 'nr cm 1
  811. 'ft 2
  812. 'ds +K
  813. 'ds -K
  814. ..
  815. 'de -C
  816. 'nr cm 0
  817. 'ft 1
  818. 'ds +K \f3
  819. 'ds -K \fP
  820. ..
  821. '+C
  822. '-C
  823. 'am +C
  824. 'ne 3
  825. ..
  826. 'de FN
  827. \f2\s14\h'\\n(.lu-\w'\\$1'u'\\$1\fP\s0\h'|0u'\c
  828. .if r x .if \\nx .if d =F .tm \\$1 \\*(=F \\n%
  829. 'ds =f \&...\\$1
  830. ..
  831. 'de FC
  832. .if r x .if \\nx .if d =F .tm \\$1 \\*(=F \\n%
  833. 'ds =f \&...\\$1
  834. ..
  835. 'de -F
  836. 'rm =f
  837. ..
  838. 'ft 1
  839. 'lg 0
  840. '-F
  841. .\" Copyright (c) 1985 The Regents of the University of California.
  842. .\" All rights reserved.
  843. .\"
  844. .\" Redistribution and use in source and binary forms, with or without
  845. .\" modification, are permitted provided that the following conditions
  846. .\" are met:
  847. .\" 1. Redistributions of source code must retain the above copyright
  848. .\" notice, this list of conditions and the following disclaimer.
  849. .\" 2. Redistributions in binary form must reproduce the above copyright
  850. .\" notice, this list of conditions and the following disclaimer in the
  851. .\" documentation and/or other materials provided with the distribution.
  852. .\" 3. All advertising materials mentioning features or use of this software
  853. .\" must display the following acknowledgement:
  854. .\" This product includes software developed by the University of
  855. .\" California, Berkeley and its contributors.
  856. .\" 4. Neither the name of the University nor the names of its contributors
  857. .\" may be used to endorse or promote products derived from this software
  858. .\" without specific prior written permission.
  859. .\"
  860. .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  861. .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  862. .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  863. .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  864. .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  865. .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  866. .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  867. .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  868. .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  869. .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  870. .\" SUCH DAMAGE.
  871. .\"
  872. .\" @(#)a2.t 5.1 (Berkeley) 4/17/91
  873. .\"
  874. .SH
  875. run (shell script)
  876. .LP
  877. .vS
  878. \*(+K#\*(-K! \fI\h'\w' 'u-\w'/'u'/\fPbin\fI\h'\w' 'u-\w'/'u'/\fPcsh \*-fx
  879. \*(+K#\*(-K Script to run benchmark programs\&.
  880. \*(+K#\*(-K
  881. date
  882. make clean; time make
  883. time syscall 100000
  884. time seqpage \*-p 7500 10
  885. time seqpage \*-v \*-p 7500 10
  886. time randpage \*-p 7500 30000
  887. time randpage \*-v \*-p 7500 30000
  888. time gausspage \*-p 7500 \*-s 1 30000
  889. time gausspage \*-p 7500 \*-s 10 30000
  890. time gausspage \*-p 7500 \*-s 30 30000
  891. time gausspage \*-p 7500 \*-s 40 30000
  892. time gausspage \*-p 7500 \*-s 50 30000
  893. time gausspage \*-p 7500 \*-s 60 30000
  894. time gausspage \*-p 7500 \*-s 80 30000
  895. time gausspage \*-p 7500 \*-s 10000 30000
  896. time csw 10000
  897. time signocsw 10000
  898. time pipeself 10000 512
  899. time pipeself 10000 4
  900. time udgself 10000 512
  901. time udgself 10000 4
  902. time pipediscard 10000 512
  903. time pipediscard 10000 4
  904. time udgdiscard 10000 512
  905. time udgdiscard 10000 4
  906. time pipeback 10000 512
  907. time pipeback 10000 4
  908. time udgback 10000 512
  909. time udgback 10000 4
  910. size forks
  911. time forks 1000 0
  912. time forks 1000 1024
  913. time forks 1000 102400
  914. size vforks
  915. time vforks 1000 0
  916. time vforks 1000 1024
  917. time vforks 1000 102400
  918. countenv
  919. size nulljob
  920. time execs 1000 0 nulljob
  921. time execs 1000 1024 nulljob
  922. time execs 1000 102400 nulljob
  923. time vexecs 1000 0 nulljob
  924. time vexecs 1000 1024 nulljob
  925. time vexecs 1000 102400 nulljob
  926. size bigjob
  927. time execs 1000 0 bigjob
  928. time execs 1000 1024 bigjob
  929. time execs 1000 102400 bigjob
  930. time vexecs 1000 0 bigjob
  931. time vexecs 1000 1024 bigjob
  932. time vexecs 1000 102400 bigjob
  933. \*(+K#\*(-K fill environment with ~1024 bytes
  934. setenv a 012345678901234567890123456789012345678901234567890123456780123456789
  935. setenv b 012345678901234567890123456789012345678901234567890123456780123456789
  936. setenv c 012345678901234567890123456789012345678901234567890123456780123456789
  937. setenv d 012345678901234567890123456789012345678901234567890123456780123456789
  938. setenv e 012345678901234567890123456789012345678901234567890123456780123456789
  939. setenv f 012345678901234567890123456789012345678901234567890123456780123456789
  940. setenv g 012345678901234567890123456789012345678901234567890123456780123456789
  941. setenv h 012345678901234567890123456789012345678901234567890123456780123456789
  942. setenv i 012345678901234567890123456789012345678901234567890123456780123456789
  943. setenv j 012345678901234567890123456789012345678901234567890123456780123456789
  944. setenv k 012345678901234567890123456789012345678901234567890123456780123456789
  945. setenv l 012345678901234567890123456789012345678901234567890123456780123456789
  946. setenv m 012345678901234567890123456789012345678901234567890123456780123456789
  947. setenv n 012345678901234567890123456789012345678901234567890123456780123456789
  948. setenv o 012345678901234567890123456789012345678901234567890123456780123456789
  949. countenv
  950. time execs 1000 0 nulljob
  951. time execs 1000 1024 nulljob
  952. time execs 1000 102400 nulljob
  953. time execs 1000 0 bigjob
  954. time execs 1000 1024 bigjob
  955. time execs 1000 102400 bigjob
  956. .vE
  957. .bp
  958. '-F