This is a heads up for what is going on on the glsl-pp-rework-2 feature 
branch.

The goal was to rewrite the existing preprocessor for GLSL compiler as a 
stepping stone for a better GLSL compiler in general. Make it faster, 
easy to understand and maintain. But the most important thing was to 
make it easy to plug a new syntax parser in the future (Ian has started 
some work towards this). That's done.

The next step was to integrate the new preprocessor with the existing 
syntax parser to allow me to measure compiler performance. The results 
were not very satisfying -- it turned out the syntax parser was such a 
huge bottleneck, it did not matter how fast the preprocessor was.

So I just hacked up a simple and fast syntax parser that basically 
emulates the old one, so that we don't have to touch too much code, 
spend too much time on it and intruduce regressions. It's not perfect, 
it looks ugly but it works well. I don't mind scrapping it and replacing 
with a new, bison-based parser. And for the time being, here are the 
numbers.

The benchmark takes CorrectConstFolding2.vert shader from the GLSL 
Compiler Test suite. It's one of the biggest files with around 400 lines 
of code. What is being timed is preprocessing + syntax parsing, so no 
further semantic checking and code generation is taken into account.

old  128,157 us
new  4,719 us
improvement  27 x

After that the new preprocessor becomes the bottleneck. That means it's 
worthwile to keep on improving it. If the preprocessing step is taken 
out of the equation and we only measure the syntax parsing stage, we get 
the following numbers.

old  124,671
new  1,016
improvement  122 x

The code for the new parse should be in mesa repository in a week or so.

Thanks.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Mesa3d-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to