]> git.eshelyaron.com Git - emacs.git/commitdiff
Synchronize cedet/semantic with Emacs.
authorxscript <xscript@users.sourceforge.net>
Sun, 15 May 2011 20:16:47 +0000 (22:16 +0200)
committerEdward John Steere <edward.steere@gmail.com>
Wed, 25 Jan 2017 18:13:42 +0000 (20:13 +0200)
test/manual/cedet/cedet/semantic/find.el [new file with mode: 0644]

diff --git a/test/manual/cedet/cedet/semantic/find.el b/test/manual/cedet/cedet/semantic/find.el
new file mode 100644 (file)
index 0000000..ce61c42
--- /dev/null
@@ -0,0 +1,42 @@
+(defun semantic-find-benchmark ()
+  "Run some simple benchmarks to see how we are doing.
+Optional argument ARG is the number of iterations to run."
+  (interactive)
+  (require 'benchmark)
+  (let ((f-name nil)
+        (b-name nil)
+        (f-comp)
+        (b-comp)
+        (f-regex)
+        )
+    (garbage-collect)
+    (setq f-name
+          (benchmark-run-compiled
+           1000 (semantic-find-first-tag-by-name "class3"
+                                                 "test/test.cpp")))
+    (garbage-collect)
+    (setq b-name
+          (benchmark-run-compiled
+              1000 (semantic-brute-find-first-tag-by-name "class3"
+                                                          "test/test.cpp")))
+    (garbage-collect)
+    (setq f-comp
+          (benchmark-run-compiled
+              1000 (semantic-find-tags-for-completion "method"
+                                                      "test/test.cpp")))
+    (garbage-collect)
+    (setq b-comp
+          (benchmark-run-compiled
+              1000 (semantic-brute-find-tag-by-name-regexp "^method"
+                                                           "test/test.cpp")))
+    (garbage-collect)
+    (setq f-regex
+          (benchmark-run-compiled
+              1000 (semantic-find-tags-by-name-regexp "^method"
+                                                      "test/test.cpp")))
+
+    (message "Name [new old] [ %.3f %.3f ] Complete [newc/new old] [ %.3f/%.3f %.3f ]"
+             (car f-name) (car b-name)
+             (car f-comp) (car f-regex)
+             (car b-comp))
+  ))