[ragel-users] Passing data to actions

Adrian Thurston thurston at colm.net
Thu Apr 19 13:55:45 UTC 2018


It's because of changes I made to support new features, without paying 
much attention to keeping code size down. I'm still working on 
correctness. When it's ready for optimization a lot of that can be 
cleaned up.

For example there are two sets of offset/targ arrays there, one prefixed 
with trans and another with cond. That's because the transition search 
has been made into a two-step process. First search on the input char, 
then test conditions, then locate the final transition. But since you 
probably don't use conditions that can be optimized back down to one.

Adrian

On 2018-04-19 02:21, Ico wrote:
> Quoting Adrian Thurston (2018-04-19 02:29:30)
> 
>> It's actually already implemented in ragel 7. See tests/args*.rl.
> 
> Sweet, I will look into that, thank you.
> 
>> Hopefully this year I'll start iterating some ragel 7 stable releases.
>> I'm almost done the researchy kind of things and soon I can start
>> addressing issues of a practical matter.
> 
> After a quick test I found that the same ragel machine compiled by 
> ragel 7
> results in a significant larger binary compared to ragel 6.10:
> 
>   ico at platdoos:/tmp$ bloat-o-meter a6 a7
>   add/remove: 5/3 grow/shrink: 6/0 up/down: 5273/-1139 (4134)
>   function                                     old     new   delta
>   _rtsp_parser_trans_offsets                     -    1478   +1478
>   _rtsp_parser_cond_targs                        -    1478   +1478
>   _rtsp_parser_trans_lengths                     -     739    +739
>   _rtsp_parser_cond_keys                         -     739    +739
>   _rtsp_parser_cond_actions                      -     739    +739
>   parse                                        640     733     +93
>   _rtsp_parser_key_offsets                     350     352      +2
>   _rtsp_parser_index_offsets                   350     352      +2
>   _rtsp_parser_single_lengths                  175     176      +1
>   _rtsp_parser_range_lengths                   175     176      +1
>   _rtsp_parser_actions                         104     105      +1
>   _rtsp_parser_trans_targs                     200       -    -200
>   _rtsp_parser_trans_actions                   200       -    -200
>   _rtsp_parser_indicies                        739       -    -739
> 
> I must admit I have not gone through the new documentation yet, but is
> there any obvious reason for this increase in size? As my parser will
> run on an embedded system with restricted resources it is always worth
> saving a few Kb's
> 
> Thanks,
> 
> Ico
> 
> --
> :wq
> ^X^Cy^K^X^C^C^C^C
> 
> _______________________________________________
> ragel-users mailing list
> ragel-users at colm.net
> http://www.colm.net/cgi-bin/mailman/listinfo/ragel-users



More information about the ragel-users mailing list