develooper Front page | perl.perl5.porters | Postings from May 2010

Re: [PATCH] shift; optimization

Thread Previous | Thread Next
From:
Ruslan Zakirov
Date:
May 3, 2010 14:03
Subject:
Re: [PATCH] shift; optimization
Message ID:
w2s589c94401005031403r1f0a0969x98bebcf4f38f19d5@mail.gmail.com
On Tue, May 4, 2010 at 12:06 AM, Reini Urban <rurban@x-ray.at> wrote:
> 2010/5/3 Ruslan Zakirov <ruz@bestpractical.com>:
>> While testing a simple benchmark script I noticed that threaded
>> version is 25% faster. I suspect that the code may be is not thread
>> safe, however don't know anything about perl threads.
>
> This is because threaded passes the my_perl struct on the stack,
> PL_op is just 4(%esi).
> Accessing stack locals is much faster than accessing a global.

I was comparing "shift;" and "shift @_;" on a threaded build. Big
difference made me nervouse. I thought that may be it's not safe to
use PL_defgv directly under threads. Vincent thinks it is safe. I'm
happy with that.

Reini and Jan thanks for interesting info.

> --
> Reini Urban
> http://phpwiki.org/           http://murbreak.at/
>



-- 
Best regards, Ruslan.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About