]> gitweb.factorcode.org Git - factor.git/commitdiff
benchmark.lcs: adding lcs benchmark.
authorJohn Benediktsson <mrjbq7@gmail.com>
Fri, 22 Mar 2013 01:07:28 +0000 (18:07 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Fri, 22 Mar 2013 01:07:28 +0000 (18:07 -0700)
extra/benchmark/lcs/lcs.factor [new file with mode: 0644]

diff --git a/extra/benchmark/lcs/lcs.factor b/extra/benchmark/lcs/lcs.factor
new file mode 100644 (file)
index 0000000..ed37e37
--- /dev/null
@@ -0,0 +1,8 @@
+USING: kernel lcs math ;
+IN: benchmark.lcs
+
+: lcs-benchmark ( -- )
+    f 50,000 [ drop "sitting" "kitten" levenshtein ] times 3 assert=
+    f 50,000 [ drop "faxbcd" "abdef" lcs ] times "abd" assert= ;
+
+MAIN: lcs-benchmark