develooper Front page | perl.perl5.porters | Postings from June 2021

Re: RFC 0004 - defer {} syntax

Thread Previous | Thread Next
From:
Yuki Kimoto
Date:
June 22, 2021 03:54
Subject:
Re: RFC 0004 - defer {} syntax
Message ID:
CAExogxND2o8NEmH_iOk+Nc1woHAoCxB39tURPuSVHmZE6CeM1A@mail.gmail.com
2021-6-21 9:24 Tom Molesworth <tom@deriv.com> wrote:

> On Mon, 21 Jun 2021 at 07:55, Yuki Kimoto <kimoto.yuki@gmail.com> wrote:
>
>> How much does defer block affect current performance of Perl?
>>
>
> The module is available on CPAN:
>
> https://metacpan.org/pod/Syntax::Keyword::Defer
>
> so this would be the best place to start if there are specific benchmarks
> you would like to try.
>
> Addition of the keyword should have no measurable impact on existing code.
>
> Performance is generally faster than the equivalent
> create-instance-and-hook-DESTROY functionality provided by modules such as
> Scope::Guard.
>
>
I want to ask a question about real logical cost.

For example,

  if (UNLIKELY(scope_has_deffer_blocks)) {

  }

This may be 1 operation if the if block is not executed.

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