changeset 44:cfaafa209424

add
author Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
date Wed, 10 Feb 2016 18:39:39 +0900
parents 724c29abb137
children cda3a0bc239d
files c4.tex memo/result.txt
diffstat 2 files changed, 39 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/c4.tex	Wed Feb 10 17:34:17 2016 +0900
+++ b/c4.tex	Wed Feb 10 18:39:39 2016 +0900
@@ -560,11 +560,18 @@
   \label{fig:cctreemerge}
 \end{figure}
 
+\newpage
+\subsection{DFA を元にパターンマッチを行う}
+NFA、DFA の生成後、読み込んだファイルに対してパターンマッチを行う。今回の例題では、
+
+\begin{itemize}
+\item DFA を生成後(NFA であれば、Subset Construction後)、逐次に状態と遷移先を照らし合わせる。
+\item DFA をkh
+\end{itemize}
+
 on the fly
 subset construction で使わない状態は生成しないで済む
 
-\newpage
-\subsection{DFA を元にパターンマッチを行う}
 
 \subsection{(Word をノードに含める話)}
 
--- a/memo/result.txt	Wed Feb 10 17:34:17 2016 +0900
+++ b/memo/result.txt	Wed Feb 10 18:39:39 2016 +0900
@@ -1,5 +1,31 @@
 Wed Feb 10 11:06:12 JST 2016
 
+egrep -o '(a|b)*a(a|b)(a|b)' file/ab500MB.txt > /dev/null
+82.88s user 0.20s system 99% cpu 1:23.09 total
+egrep 83.09
+
+./cerium/ceriumGrep -regex '(a|b)*a(a|b)(a|b)' -file file/ab500MB.txt -cpu 8   32.82s user 0.85s system 202% cpu 16.595 total
+[キャッシュ有]
+cpu time
+ 1 29.053
+ 2 24.032
+ 4 21.091
+ 8 16.595
+
+[キャッシュ無 mmap]
+cpu time
+ 1 57.654
+ 2 48.683
+ 4 43.959
+ 8 33.365
+
+[キャッシュ無 bread]
+cpu time
+ 1 40.494
+ 2 36.912
+ 4 33.718
+ 8 34.257
+
 ./cerium/ceriumGrep -regex '[A-Z][a-zA-Z0-9_]*' -file file/500MB.txt >   25.29s user 0.53s system 100% cpu 25.721 total
 
 [キャッシュ有]
@@ -33,12 +59,16 @@
  7  15.388
  8  15.901
 
+-- DFA を生成後、配列にアクセスして状態遷移--
+
 [キャッシュ無]
 ./regexParser -subset -regex '[A-Z][a-zA-Z0-9_]*' -ts -file file/500MB.txt >   16.06s user 0.22s system 77% cpu 21.139 total
 
 [キャッシュ有]
 ./regexParser -subset -regex '[A-Z][a-zA-Z0-9_]*' -ts -file file/500MB.txt >   16.05s user 0.19s system 99% cpu 16.246 total
 
+-- cgrep , egrep --
+
 cgrep -G '[A-Z][a-zA-Z0-9_]*' file/500MB.txt --no-line-umber --no-filename >/dev/null
 測れない(2時間ぐらいぶんまわしてた)