Mercurial > hg > xemacs-beta
comparison lisp/utils/bench.el @ 74:54cc21c15cbb r20-0b32
Import from CVS: tag r20-0b32
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:04:33 +0200 |
parents | b9518feda344 |
children | 1ce6082ce73f |
comparison
equal
deleted
inserted
replaced
73:e2d7a37b7c8d | 74:54cc21c15cbb |
---|---|
69 (bench-mark-8 . "Loop Computation") | 69 (bench-mark-8 . "Loop Computation") |
70 (bench-mark-9 . "Make a Few Large Size List") | 70 (bench-mark-9 . "Make a Few Large Size List") |
71 (bench-mark-10 . "Garbage Collection Large Size List") | 71 (bench-mark-10 . "Garbage Collection Large Size List") |
72 (bench-mark-11 . "Make Several Small Size List") | 72 (bench-mark-11 . "Make Several Small Size List") |
73 (bench-mark-12 . "Garbage Collection Small Size List") | 73 (bench-mark-12 . "Garbage Collection Small Size List") |
74 (bench-mark-13 . "Append to buffer") | |
74 )) | 75 )) |
75 | 76 |
76 (defconst bench-enabled-profiling nil | 77 (defconst bench-enabled-profiling nil |
77 "If non-nil and the underlying emacs supports it, do function profiling.") | 78 "If non-nil and the underlying emacs supports it, do function profiling.") |
78 | 79 |
185 | 186 |
186 ;----------------------------------------------------------------------------- | 187 ;----------------------------------------------------------------------------- |
187 (defun bench-mark-12 () | 188 (defun bench-mark-12 () |
188 (garbage-collect) | 189 (garbage-collect) |
189 ) | 190 ) |
191 | |
192 ;----------------------------------------------------------------------------- | |
193 (defun bench-mark-13 () | |
194 (unwind-protect | |
195 (let ((a 100000)) | |
196 (set-buffer (get-buffer-create "*tmp*")) | |
197 (erase-buffer) | |
198 (while (> a 0) | |
199 (insert "0123456789\n") | |
200 (setq a (1- a)))) | |
201 (kill-buffer "*tmp*"))) | |
202 | |
190 | 203 |
191 ;============================================================================= | 204 ;============================================================================= |
192 (defun bench-init () | 205 (defun bench-init () |
193 "Initialize profiling for bench marking package." | 206 "Initialize profiling for bench marking package." |
194 (if (fboundp 'start-profiling) | 207 (if (fboundp 'start-profiling) |