Re: [Mesa-dev] [PATCH 11/12] glcpp: Create fast path hand-written scanner

2017-01-08 Thread Vladislav Egorov
08.01.2017 17:11, Grazvydas Ignotas пишет: On Sat, Jan 7, 2017 at 9:02 PM, Vladislav Egorov wrote: @@ -582,6 +609,333 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]? %% +static void +glcpp_fast_skip_singleline_comment (glcpp_parser_t *parser, char **input) +{ + /* Skip // */ + cha

Re: [Mesa-dev] [PATCH 11/12] glcpp: Create fast path hand-written scanner

2017-01-08 Thread Grazvydas Ignotas
On Sun, Jan 8, 2017 at 4:11 PM, Grazvydas Ignotas wrote: > On Sat, Jan 7, 2017 at 9:02 PM, Vladislav Egorov wrote: >> @@ -582,6 +609,333 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]? >> >> %% >> >> +static void >> +glcpp_fast_skip_singleline_comment (glcpp_parser_t *parser, char **input) >

Re: [Mesa-dev] [PATCH 11/12] glcpp: Create fast path hand-written scanner

2017-01-08 Thread Grazvydas Ignotas
On Sat, Jan 7, 2017 at 9:02 PM, Vladislav Egorov wrote: > @@ -582,6 +609,333 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]? > > %% > > +static void > +glcpp_fast_skip_singleline_comment (glcpp_parser_t *parser, char **input) > +{ > + /* Skip // */ > + char *buf = *input + 2; > + > + wh

[Mesa-dev] [PATCH 11/12] glcpp: Create fast path hand-written scanner

2017-01-07 Thread Vladislav Egorov
At this point up to ~80% of preprocessing time is spent in generated parser/lexer functions, so it's not possible to improve speed further without making changes to lexer and parser. In most of the cases all complex machinery of tokenizing, parsing and printing is completely unnecessary. On most of