develooper Front page | perl.perl5.porters | Postings from October 2012

Re: Compile option to disable taint mode: speedup

Thread Previous | Thread Next
Reini Urban
October 9, 2012 17:44
Re: Compile option to disable taint mode: speedup
Message ID:
On Tue, Oct 9, 2012 at 11:29 AM, Steffen Mueller <> wrote:
> Dear all,
> After reading Reini's blog post, I spent a commute on adding a compile flag
> (-DNO_TAINT_SUPPORT) that replaces virtually all taint-related operations
> with no-ops. It's in a branch on camel at smueller/no_taint and can't go to
> blead quite as-is.
> The upshot is that a the basic script that I had used for profiling function
> call overhead now runs somewhere around 10-20% faster. Just compiling
> normally, I saw on the order of 18%. With Nicholas' set of "let's try to
> avoid alignment issues"[1] flags, I still see 12%. It's a micro-benchmark,
> so don't assign too much meaning. Either way, it's *known* to shed
> instructions.
> Any more sophisticated commetns than Reini's "10% don't matter"?

10% do not matter for me, when I work on the 1000%-2000% level, sorry.

Improving speed by 10% disabling taint checks is a nobrainer to me, since the
win is minimal, and there are much better optimizations options available.

I was talking about 10-20% wins in nextstate, TAINT being the simpliest one.
Omitting unneeded resetting the stask, and FREETMPS would be a better win
if you target the 10-20% micro-level, since this would not change any

I would rather suggest reading my blog posts about the real wins: aelem, helem,
types (no magic, no autovivification) and unneeded stack handling.
So far I'm at a 650% faster optimized perl in nbody and 175% in
fannkuchredux, but
1000% should be doable. (=10x times faster).
That would be 46min down to 4.6m with fannkuchredux 12 and 23min down
to 2.3m with nbody 50,000,000.
Reini Urban

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About