Don't use strlen inside of loop
This could hurt performance quite a bit.
BUG=296
TEST=
Committed: https://code.google.com/p/angleproject/source/detail?r=993
I would have hoped the compiler was smart enough to hoist the strlen out of ...
13 years, 6 months ago
(2012-02-21 14:34:19 UTC)
#3
I would have hoped the compiler was smart enough to hoist the strlen out of the
loop condition so that this wouldn't truly be n^2. In any case, the memcpy will
be much more efficient than a character by character copy.
LGTM, but would prefer if you also fix the one in Program.cpp as well.
On 2012/02/21 14:34:19, dgkoch wrote: > I would have hoped the compiler was smart enough ...
13 years, 6 months ago
(2012-02-21 23:43:36 UTC)
#6
On 2012/02/21 14:34:19, dgkoch wrote:
> I would have hoped the compiler was smart enough to hoist the strlen out of
the
> loop condition so that this wouldn't truly be n^2. In any case, the memcpy
will
> be much more efficient than a character by character copy.
>
I think possible aliasing prevents that.
> LGTM, but would prefer if you also fix the one in Program.cpp as well.
Ok, will do.
Issue 5675086: Don't use strlen inside of loop
(Closed)
Created 13 years, 6 months ago by John Bauman
Modified 13 years, 6 months ago
Reviewers: Zhenyao Mo, dgkoch, zmo, nfullagar
Base URL: https://angleproject.googlecode.com/svn/trunk
Comments: 0