chars.bm 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. ;;; coding: latin1 -*- mode: scheme; coding: latin-1; -*-
  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. (define-module (benchmarks chars)
  22. :use-module (benchmark-suite lib))
  23. (with-benchmark-prefix "chars"
  24. (benchmark "char" 1000000
  25. #\a)
  26. (benchmark "octal" 1000000
  27. #\123)
  28. (benchmark "char? eq" 1000000
  29. (char? #\a))
  30. (benchmark "char=?" 1000000
  31. (char=? #\a #\a))
  32. (benchmark "char<?" 1000000
  33. (char=? #\a #\a))
  34. (benchmark "char-ci=?" 1000000
  35. (char=? #\a #\a))
  36. (benchmark "char-ci<? " 1000000
  37. (char=? #\a #\a))
  38. (benchmark "char->integer" 1000000
  39. (char->integer #\a))
  40. (benchmark "char-alphabetic?" 1000000
  41. (char-upcase #\a))
  42. (benchmark "char-numeric?" 1000000
  43. (char-upcase #\a)))