Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • I was always under the impression that perl method dispatch was what caused things to take such a long time. If that's the case, then surely having methods execute faster once they've been dispatched to, wouldn't help much.

    Or am I missing the point (or should that be the profile?) here?

    -Dom

    • Perl method dispatch is slow but perl code for accessors is not fast also. Here an example (one accessor is implemented in Perl and another in C with help of Inline::C):

      use Benchmark;

      my $obj = A->new;
      $obj->field1('test');
      $obj->field2('test');

      timethese(1000000,
      &nb sp;         { pure_perl => sub { $obj->field1($obj->field1) },
                  inline_c  => sub { $obj->field2($obj->field2) }
                })

      --

      Ilya Martynov (http://martynov.org/ [martynov.org])