
AFTER INSTRUMENTING lp_match:


> rosie.file.load(e, "/Users/jjennings/Data/syslog.rpl", "rpl")
table: 0x7ff763d34e90	/Users/jjennings/Data/syslog.rpl
> syslog = rosie._env.environment.lookup(e._env, "syslog").tlpeg
> 
> nl = io.lines("/Users/jjennings/Data/syslog2M.log"); line = nl()
> acc0 = 0; acc1 = 0; while line do m, left, acc0, acc1 = syslog:r_match(line, 1, acc0, acc1); line=nl(); end; print(acc0, acc1, acc0+acc1)
2,810,593	29,331,908	32,142,501
> nl = io.lines("/Users/jjennings/Data/syslog2M.log"); line = nl()
> acc0 = 0; acc1 = 0; while line do m, left, acc0, acc1 = syslog:r_match(line, 1, acc0, acc1); line=nl(); end; print(acc0, acc1, acc0+acc1)
3,159,180	32,057,568	35,216,748
> nl = io.lines("/Users/jjennings/Data/syslog2M.log"); line = nl()
> acc0 = 0; acc1 = 0; while line do m, left, acc0, acc1 = syslog:r_match(line, 1, acc0, acc1); line=nl(); end; print(acc0, acc1, acc0+acc1)
2,837,596	29,383,338	32,220,934
> nl = io.lines("/Users/jjennings/Data/syslog2M.log"); line = nl()
> acc0 = 0; acc1 = 0; while line do m, left, acc0, acc1 = syslog:r_match(line, 1, acc0, acc1); line=nl(); end; print(acc0, acc1, acc0+acc1)
2,842,178	29,439,010	32,281,188
> 


USING: common.create_match = lpeg.r_create_match

> nl = io.lines("/Users/jjennings/Data/syslog2M.log"); line = nl()
> acc0 = 0; acc1 = 0; while line do m, left, acc0, acc1 = syslog:r_match(line, 1, acc0, acc1); line=nl(); end; print(acc0, acc1, acc0+acc1)
2,810,593	29,331,908	32,142,501
> nl = io.lines("/Users/jjennings/Data/syslog2M.log"); line = nl()
> acc0 = 0; acc1 = 0; while line do m, left, acc0, acc1 = syslog:r_match(line, 1, acc0, acc1); line=nl(); end; print(acc0, acc1, acc0+acc1)
3,159,180	32,057,568	35,216,748
> nl = io.lines("/Users/jjennings/Data/syslog2M.log"); line = nl()
> acc0 = 0; acc1 = 0; while line do m, left, acc0, acc1 = syslog:r_match(line, 1, acc0, acc1); line=nl(); end; print(acc0, acc1, acc0+acc1)
2,837,596	29,383,338	32,220,934
> nl = io.lines("/Users/jjennings/Data/syslog2M.log"); line = nl()
> acc0 = 0; acc1 = 0; while line do m, left, acc0, acc1 = syslog:r_match(line, 1, acc0, acc1); line=nl(); end; print(acc0, acc1, acc0+acc1)
2,842,178	29,439,010	32,281,188
>

--> No appreciable difference.  But this is no suprise, because the only
    difference between the two sets above is that the second one has a function
    capture that is a C function, and the first is a Lua function.  But the C
    function is callable from Lua, so the calling convention is the same, so why
    would there be a difference in performance?

    This was a first step.

    Conclusion from first step: The cost of preparing the Lua tables from the
    capture data is not affected noticeably when the function called (in a
    function capture) is a C function versus a Lua function.

--> Next step is to streamline further, perhaps by creating our own new capture type?


