[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: destructive iteration patterns
- From: Josh Haberman <jhaberman@...>
- Date: Tue, 12 Apr 2011 22:05:11 +0000 (UTC)
Josh Haberman <jhaberman <at> gmail.com> writes:
> As you can see, avoiding the malloc/free and memcpy sped up my
> benchmark by >60%. You might expect then that malloc/free/memcpy
> would show up as 60% of the profile in the slowest case, but this is
> actually not the case -- they show up as more like 20%.
Whoops, that's some sloppy math. If something yields a 60% speedup,
(ie. rate is 1.6x original rate) you would expect it to take 1/1.6=62% of
its original time, implying that the part you had optimized away took
38% of the original time. But this is still greater than the 20% I observed,
so the point is still valid.
Josh