Commit | Line | Data |
---|---|---|
59047043 | 1 | ;;; coding: latin1 -*- mode: scheme; coding: latin-1; -*- |
3dd11c9b MG |
2 | ;;; chars.bm |
3 | ;;; | |
4 | ;;; Copyright (C) 2009 Free Software Foundation, Inc. | |
5 | ;;; | |
6 | ;;; | |
7 | ;;; This program is free software; you can redistribute it and/or | |
8 | ;;; modify it under the terms of the GNU Lesser General Public License | |
9 | ;;; as published by the Free Software Foundation; either version 3, or | |
10 | ;;; (at your option) any later version. | |
11 | ;;; | |
12 | ;;; This program is distributed in the hope that it will be useful, | |
13 | ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | ;;; GNU Lesser General Public License for more details. | |
16 | ;;; | |
17 | ;;; You should have received a copy of the GNU Lesser General Public | |
18 | ;;; License along with this software; see the file COPYING.LESSER. If | |
19 | ;;; not, write to the Free Software Foundation, Inc., 51 Franklin | |
20 | ;;; Street, Fifth Floor, Boston, MA 02110-1301 USA | |
21 | ||
22 | (define-module (benchmarks chars) | |
23 | :use-module (benchmark-suite lib)) | |
24 | ||
25 | \f | |
26 | (with-benchmark-prefix "chars" | |
27 | ||
28 | (benchmark "char" 1000000 | |
29 | #\a) | |
30 | ||
31 | (benchmark "octal" 1000000 | |
32 | #\123) | |
33 | ||
34 | (benchmark "char? eq" 1000000 | |
35 | (char? #\a)) | |
36 | ||
37 | (benchmark "char=?" 1000000 | |
38 | (char=? #\a #\a)) | |
39 | ||
40 | (benchmark "char<?" 1000000 | |
41 | (char=? #\a #\a)) | |
42 | ||
43 | (benchmark "char-ci=?" 1000000 | |
44 | (char=? #\a #\a)) | |
45 | ||
46 | (benchmark "char-ci<? " 1000000 | |
47 | (char=? #\a #\a)) | |
48 | ||
49 | (benchmark "char->integer" 1000000 | |
50 | (char->integer #\a)) | |
51 | ||
52 | (benchmark "char-alphabetic?" 1000000 | |
53 | (char-upcase #\a)) | |
54 | ||
55 | (benchmark "char-numeric?" 1000000 | |
56 | (char-upcase #\a))) | |
57 |