diff options
| author | The Android Open Source Project <initial-contribution@android.com> | 2009-03-03 18:28:41 -0800 |
|---|---|---|
| committer | The Android Open Source Project <initial-contribution@android.com> | 2009-03-03 18:28:41 -0800 |
| commit | 648161bb0edfc3d43db63caed5cc5213bc6cb78f (patch) | |
| tree | 4b825dc642cb6eb9a060e54bf8d69288fbee4904 /WebKitTools/android/flex-2.5.4a/MISC/fastwc/README | |
| parent | a65af38181ac7d34544586bdb5cd004de93897ad (diff) | |
| download | external_webkit-648161bb0edfc3d43db63caed5cc5213bc6cb78f.zip external_webkit-648161bb0edfc3d43db63caed5cc5213bc6cb78f.tar.gz external_webkit-648161bb0edfc3d43db63caed5cc5213bc6cb78f.tar.bz2 | |
auto import from //depot/cupcake/@135843
Diffstat (limited to 'WebKitTools/android/flex-2.5.4a/MISC/fastwc/README')
| -rw-r--r-- | WebKitTools/android/flex-2.5.4a/MISC/fastwc/README | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/WebKitTools/android/flex-2.5.4a/MISC/fastwc/README b/WebKitTools/android/flex-2.5.4a/MISC/fastwc/README deleted file mode 100644 index 0dd3afe..0000000 --- a/WebKitTools/android/flex-2.5.4a/MISC/fastwc/README +++ /dev/null @@ -1,56 +0,0 @@ -This directory contains some examples illustrating techniques for extracting -high-performance from flex scanners. Each program implements a simplified -version of the Unix "wc" tool: read text from stdin and print the number of -characters, words, and lines present in the text. All programs were compiled -using gcc (version unavailable, sorry) with the -O flag, and run on a -SPARCstation 1+. The input used was a PostScript file, mainly containing -figures, with the following "wc" counts: - - lines words characters - 214217 635954 2592172 - - -The basic principles illustrated by these programs are: - - - match as much text with each rule as possible - - adding rules does not slow you down! - - avoid backing up - -and the big caveat that comes with them is: - - - you buy performance with decreased maintainability; make - sure you really need it before applying the above techniques. - -See the "Performance Considerations" section of flexdoc for more -details regarding these principles. - - -The different versions of "wc": - - mywc.c - a simple but fairly efficient C version - - wc1.l a naive flex "wc" implementation - - wc2.l somewhat faster; adds rules to match multiple tokens at once - - wc3.l faster still; adds more rules to match longer runs of tokens - - wc4.l fastest; still more rules added; hard to do much better - using flex (or, I suspect, hand-coding) - - wc5.l identical to wc3.l except one rule has been slightly - shortened, introducing backing-up - -Timing results (all times in user CPU seconds): - - program time notes - ------- ---- ----- - wc1 16.4 default flex table compression (= -Cem) - wc1 6.7 -Cf compression option - /bin/wc 5.8 Sun's standard "wc" tool - mywc 4.6 simple but better C implementation! - wc2 4.6 as good as C implementation; built using -Cf - wc3 3.8 -Cf - wc4 3.3 -Cf - wc5 5.7 -Cf; ouch, backing up is expensive |
