[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/parseclj 6fe4ce6095 058/185: Add script to compare speed o
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/parseclj 6fe4ce6095 058/185: Add script to compare speed of edn.el and clj-parse.el |
Date: |
Tue, 28 Dec 2021 14:05:17 -0500 (EST) |
branch: elpa/parseclj
commit 6fe4ce6095321f59e936f4d221f85b464bfaf433
Author: Arne Brasseur <arne@arnebrasseur.net>
Commit: Arne Brasseur <arne@arnebrasseur.net>
Add script to compare speed of edn.el and clj-parse.el
---
clj-lex.el | 4 ++--
clj-parse.el | 10 ++++++----
tests/speed-comparison.el | 21 +++++++++++++++++++++
3 files changed, 29 insertions(+), 6 deletions(-)
diff --git a/clj-lex.el b/clj-lex.el
index e0bdb6d21f..3e81c34223 100644
--- a/clj-lex.el
+++ b/clj-lex.el
@@ -155,7 +155,6 @@ behavior."
(let ((pos (point)))
(right-char)
(while (not (or (equal (char-after (point)) ?\") (clj-lex-at-eof?)))
- (message (buffer-substring-no-properties pos (point)))
(if (equal (char-after (point)) ?\\)
(right-char 2)
(right-char)))
@@ -292,7 +291,8 @@ behavior."
(right-char))
(clj-lex-token :lex-error (buffer-substring-no-properties pos
(point)) pos 'error-type :invalid-hashtag-dispatcher)))))
- ":("))))
+ (t
+ (concat ":(" (char-to-string char)))))))
(provide 'clj-lex)
diff --git a/clj-parse.el b/clj-parse.el
index 163c7441e6..e55a8ba379 100644
--- a/clj-parse.el
+++ b/clj-parse.el
@@ -130,14 +130,16 @@
(let ((node (pop stack)))
(funcall reduceN stack node coll))
;; Syntax error
- (error "Syntax Error"))))
+ (progn
+ (message "STACK: %S , CLOSER: %S" stack closer-token)
+ (error "Syntax Error")))))
(defun clj-parse-reduce (reduce-leaf reduce-node)
(let ((stack nil))
(while (not (eq (clj-lex-token-type (setq token (clj-lex-next))) :eof))
- (message "STACK: %S" stack)
- (message "TOKEN: %S\n" token)
+ ;; (message "STACK: %S" stack)
+ ;; (message "TOKEN: %S\n" token)
;; Reduce based on the top item on the stack (collections)
(let ((token-type (clj-lex-token-type token)))
@@ -154,7 +156,7 @@
;; reduce root
(setf stack (funcall reduce-node stack '((type . :root) (pos . 0)) stack))
- (message "RESULT: %S" stack)
+ ;; (message "RESULT: %S" stack)
stack))
diff --git a/tests/speed-comparison.el b/tests/speed-comparison.el
new file mode 100644
index 0000000000..8f315be5d3
--- /dev/null
+++ b/tests/speed-comparison.el
@@ -0,0 +1,21 @@
+(with-current-buffer (find-file-noselect "/home/arne/tmp/edn2.list")
+ (goto-char 1)
+ (while (and (< (point) (point-max)))
+ (end-of-line)
+ (let* ((fn (buffer-substring-no-properties (line-beginning-position)
(point)))
+ (buff (find-file-noselect fn))
+ (edn-time 0)
+ (clj-time 0))
+ ;;(message fn)
+ (with-current-buffer buff
+ (let ((start (time-to-seconds (current-time))))
+ (clj-parse-edn)
+ (setq clj-time (+ clj-time (- (time-to-seconds (current-time))
start))))
+ (goto-char 1)
+ (let ((start (time-to-seconds (current-time))))
+ (edn-read)
+ (setq edn-time (+ edn-time (- (time-to-seconds (current-time))
start)))))
+ (kill-buffer buff)
+ (when (< (point) (point-max)) (right-char))
+ (with-current-buffer "*edn-parse-time-results*"
+ (insert "{:file \"" fn "\", :edn-time " (number-to-string edn-time) ",
:clj-time " (number-to-string clj-time) "}\n")))))
- [nongnu] elpa/parseclj 4f647c8cff 036/185: Remove duplicate defination of clj-lex--token-token, (continued)
- [nongnu] elpa/parseclj 4f647c8cff 036/185: Remove duplicate defination of clj-lex--token-token, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 1b2b221c98 038/185: Add AST to Elisp and Clojure/EDN printers, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 9404763e11 042/185: Make sure Travis uses the right Emacs, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 29411e2103 045/185: Add a design document to share vision and collect feedback, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 0702332e5d 046/185: Merge branch 'master' of https://github.com/lambdaisland/clj-parse, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 553f8618e1 044/185: Rework `clj-parse-deftest` macro, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj da89bf82a3 050/185: Allow colons inside symbols, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 81fe979450 051/185: Handle parsing of semicolon-based comments., ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj a424f87c1b 054/185: :#/# is a valid keyword. :::hello is not, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj f34b8460a8 055/185: Correctly parse numbers in scientific notation, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 6fe4ce6095 058/185: Add script to compare speed of edn.el and clj-parse.el,
ELPA Syncer <=
- [nongnu] elpa/parseclj 7d70ee4c38 059/185: Add support for tagged literals, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 4367db07aa 061/185: Move tests to tests/, bench to benchmark/, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 46570ce843 060/185: A # can be part of a symbol, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj fcd1a086f6 081/185: Rename clj-ast to parseclj-ast, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 987bd16a57 089/185: Position starts at 1, not at 0 (just like (point)), ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 313fc4e630 077/185: Rename to parseclj, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 7f8bcd405e 095/185: Make checkdoc happy with parseclj.el, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 0f16fcf2fa 084/185: Implement parsing with lexical preservation (keep whitespace, comments), ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj ca854455f6 099/185: Add missing requirement to `parseedn`, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj adbc0cabf5 100/185: Move `parseclj--{leaf, closing}-tokens` to `parseclj-lex` module, ELPA Syncer, 2021/12/28