Hatena::Groupcadr

わだばLisperになる このページをアンテナに追加 RSSフィード

2004 | 12 |
2005 | 01 | 02 | 07 | 10 | 11 |
2006 | 06 | 07 | 08 | 09 | 10 | 11 | 12 |
2007 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 | 12 |
2008 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 | 12 |
2009 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 | 12 |
2010 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 | 12 |
2011 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 11 |

2011-03-05

読み書きの速度 (2)

| 18:08 | 読み書きの速度 (2) - わだばLisperになる を含むブックマーク はてなブックマーク - 読み書きの速度 (2) - わだばLisperになる

前回の測定で何か足りない、と思っていたのですが、良く使うalistが抜けていたのに気付いたので再度測定。

お馴染のalistではありますが、リストだけに要素数が増えると遅かったりするんですね。

=========================== READ ===========================
  0.040 sec. CLOSURE-1-READ
  0.041 sec. SYMBOL-PLIST-1-READ
  0.041 sec. LEXICAL-PLIST-1-READ
  0.062 sec. LEXICAL-VECTOR-1-READ
  0.062 sec. GLOBAL-SPECIAL-1-READ
  0.063 sec. LEXICAL-VAR-READ
  0.063 sec. STRUCT-10-READ
  0.063 sec. LEXICAL-CONS-1-READ
  0.063 sec. STRUCT-1-READ
  0.063 sec. HASH-10-READ
  0.063 sec. LEXICAL-VECTOR-10-READ
  0.063 sec. HASH-1-READ
  0.063 sec. LOCAL-SPECIAL-1-READ
  0.064 sec. SYMBOL-PLIST-10-READ
  0.121 sec. SYMBOL-VALUE-1-READ
  0.146 sec. LEXICAL-PLIST-10-READ
  0.778 sec. CLASS-1-READ
  1.132 sec. LEXICAL-ALIST-1-READ
  1.228 sec. CLASS-10-READ
  2.685 sec. LEXICAL-CONS-10-READ
  3.882 sec. LEXICAL-ALIST-10-READ
========================== WRITE ===========================
  0.041 sec. LEXICAL-VAR-WRITE
  0.063 sec. CLOSURE-1-WRITE
  0.069 sec. LEXICAL-CONS-1-WRITE
  0.140 sec. STRUCT-10-WRITE
  0.143 sec. STRUCT-1-WRITE
  0.145 sec. LEXICAL-VECTOR-10-WRITE
  0.149 sec. LEXICAL-VECTOR-1-WRITE
  0.189 sec. GLOBAL-SPECIAL-1-WRITE
  0.226 sec. LOCAL-SPECIAL-1-WRITE
  0.727 sec. LEXICAL-PLIST-1-WRITE
  1.132 sec. LEXICAL-ALIST-1-WRITE
  1.146 sec. CLASS-1-WRITE
  1.159 sec. CLASS-10-WRITE
  1.371 sec. SYMBOL-PLIST-1-WRITE
  1.382 sec. HASH-1-WRITE
  1.924 sec. HASH-10-WRITE
  3.143 sec. LEXICAL-CONS-10-WRITE
  3.593 sec. LEXICAL-PLIST-10-WRITE
  3.952 sec. LEXICAL-ALIST-10-WRITE
  5.871 sec. SYMBOL-PLIST-10-WRITE
107.203 sec. SYMBOL-VALUE-1-WRITE
(defun lexical-alist-1-write ()
  (let ((x (acons :x 0 ())))
    (dotimes (i one-hundred-million)
      (setf (cdr (assoc :x x)) i))))

(defun lexical-alist-1-read ()
  (let ((x (acons :x 0 ())))
    (dotimes (i one-hundred-million)
      (values (cdr (assoc :x x))))))

(defun lexical-alist-10-write ()
  (let ((x (reverse (acons :x 0 (make-list 9 :initial-element (list (gensym) (gensym)))))))
    (dotimes (i one-hundred-million)
      (setf (cdr (assoc :x x)) i))))

(defun lexical-alist-10-read ()
  (let ((x (reverse (acons :x 0 (make-list 9 :initial-element (list (gensym) (gensym)))))))
    (dotimes (i one-hundred-million)
      (values (cdr (assoc :x x))))))