Return-Path: Delivered-To: apmail-perl-dev-archive@www.apache.org Received: (qmail 92703 invoked from network); 4 Mar 2005 04:41:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 4 Mar 2005 04:41:48 -0000 Received: (qmail 54602 invoked by uid 500); 4 Mar 2005 04:41:47 -0000 Delivered-To: apmail-perl-dev-archive@perl.apache.org Received: (qmail 54584 invoked by uid 500); 4 Mar 2005 04:41:47 -0000 Mailing-List: contact dev-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Delivered-To: mailing list dev@perl.apache.org Received: (qmail 54568 invoked by uid 99); 4 Mar 2005 04:41:47 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from mail.logilune.com (HELO mail.logilune.com) (195.80.154.36) by apache.org (qpsmtpd/0.28) with ESMTP; Thu, 03 Mar 2005 20:41:46 -0800 Received: from [127.0.0.1] (localhost.logilune.com [127.0.0.1]) by mail.logilune.com (Postfix) with ESMTP id 1F06D1E1965; Fri, 4 Mar 2005 05:41:42 +0100 (CET) Message-ID: <4227E705.7010009@stason.org> Date: Thu, 03 Mar 2005 23:41:41 -0500 From: Stas Bekman Organization: Hope, Humanized User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041217 X-Accept-Language: en-us, en, he, ru MIME-Version: 1.0 To: Joe Schaefer Cc: dev@perl.apache.org Subject: Re: ACL filesystem incompatibility and potential race condition References: <42252B04.4080407@stason.org> <4225BB2B.1050707@stason.org> <42264D18.3000503@stason.org> <4226711A.9000501@stason.org> <422710FA.2010600@stason.org> <4227AB9F.6000605@stason.org> <4227AFCB.6020502@stason.org> <87ll94rxli.fsf@gemini.sunstarsys.com> <4227BF9A.9010609@stason.org> <87hdjsrwfu.fsf@gemini.sunstarsys.com> <4227C5CC.9080405@stason.org> <87d5ugrtn5.fsf@gemini.sunstarsys.com> In-Reply-To: <87d5ugrtn5.fsf@gemini.sunstarsys.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Joe Schaefer wrote: > Stas Bekman writes: > > [...] > > >>Two questions: >> >>1) did you by chance look at how this magic is generated? > > > I'm not sure exactly how it all works; probably some combination > of overload.pm and internal support from perl itself. I think > all the fallback option actually does is set > > ${"APR::Error::()"} = 1 > > >>Do we pay any penalty for letting overload handle that? > > > IMO the costs are comparable to everything else related to > using overload, so I don't expect it to be too costly. > I could be wrong though, so benchmark that if it's a concern. The 'fallback' approach is almost 3 times slower: Benchmark: timing 1000000 iterations of explicit, fallback ... explicit: 6 wallclock secs ( 4.17 usr + 0.05 sys = 4.22 CPU) @ 236966.82/s (n=1000000) fallback: 14 wallclock secs (11.22 usr + 0.10 sys = 11.32 CPU) @ 88339.22/s (n=1000000) here is the benchmark: use strict; use warnings; package A; use overload fallback => 1, '0+' => sub { $_[0]->[0] }; sub new { bless [5], __PACKAGE__ }; package B; use overload '==' => sub { $_[0]->[0] == $_[1] }, '0+' => sub { $_[0]->[0] }; sub new { bless [5], __PACKAGE__ } package main; use Benchmark qw(timethese) ; my $a = A->new; my $b = B->new; timethese(1_000_000, { 'fallback' => sub { $a == 5 ? "OK" : "NOK"}, 'explicit' => sub { $b == 5 ? "OK" : "NOK"}, }); >>2) is it safe to rely on the magic for other ops we haven't thought >>of? > > I think so. If not, I'd say that's a bug in overload.pm itself. Well, I just reported a segfault caused by overload (well it can be easily avoided, was caused by a recursive overload). How about we keep an explicit mapping for now and add fallback if later we will see that there is a need for it? -- __________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:stas@stason.org http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org For additional commands, e-mail: dev-help@perl.apache.org