glcpp: Don't strlen() the output for every token being printed.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 10 Feb 2012 04:33:44 +0000 (20:33 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 28 Feb 2012 21:07:12 +0000 (13:07 -0800)
commitb823b99ec0f13af257dcd885f436a4d294c6222a
treea14501441c082303589b10821ca56c9554c57dc1
parent8292b7419d0405e94a5ea270ba710d20f0eb071f
glcpp: Don't strlen() the output for every token being printed.

The ralloc string appending functions were originally intended for
simple, non-hot-path uses like printing to an info log.

Cuts Unigine Tropics load time by around 20% (6 seconds).

v2: Avoid strlen() on every newline, too.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> [v1]
Acked-by: José Fonseca <jfonseca@vmware.com> [v1]
src/glsl/glcpp/glcpp-parse.y
src/glsl/glcpp/glcpp.h