Changes between Version 1 and Version 2 of LLVM_ToolDemo


Ignore:
Timestamp:
Mar 12, 2014, 12:02:18 AM (5 years ago)
Author:
cameron
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • LLVM_ToolDemo

    v1 v2  
    1515}}}
    1616
     17Now let's compile code for matching the regular expression: {{{([a-zA-Z][a-zA-Z0-9]*)://([^ /]+)(/[^ ]*)?|([^ @]+)@([^ @]+)}}}.
     18It should be in the file {{{RE/data/test/test1.re}}}, modify as needed.   Now run the regular
     19compilation chain with gcc.
    1720
     21{{{
     22cd RE
     23make
     24cd output
     25make
     26cd src
     27make
     28}}}
     29
     30Hmm.  A lot of work, but now we have the executable in {{{re}}}.
     31Let's look at how it performs.
     32
     33{{{
     34perf stat -e cycles:u,instructions:u ./re ../../performance/data/howto -c
     35Matching Lines:32539
     36
     37 Performance counter stats for './re ../../performance/data/howto -c':
     38
     39        95,090,095 cycles:u                  #    0.000 GHz                   
     40       216,535,343 instructions:u            #    2.28  insns per cycle       
     41
     42       0.034277223 seconds time elapsed
     43
     44}}}
     45
     46Your results with vary, depending on your machine.
     47For interest, let's compare with egrep.
     48{{{
     49perf stat -e cycles:u,instructions:u egrep '([a-zA-Z][a-zA-Z0-9]*)://([^ /]+)(/[^ ]*)?|([^ @]+)@([^ @]+)' ../../performance/data/howto -c
     5032539
     51
     52 Performance counter stats for 'egrep ([a-zA-Z][a-zA-Z0-9]*)://([^ /]+)(/[^ ]*)?|([^ @]+)@([^ @]+) ../../performance/data/howto -c':
     53
     54    43,229,901,018 cycles:u                  #    0.000 GHz                   
     55   109,259,361,636 instructions:u            #    2.53  insns per cycle       
     56
     57      11.437203814 seconds time elapsed
     58}}}
     59
     60Well egrep found the same number of matches, but about 300X slower!