Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Exception-Class CPAN distribution.

Report information
The Basics
Id: 40221
Status: resolved
Priority: 0/
Queue: Exception-Class

People
Owner: Nobody in particular
Requestors: RUZ [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.24
Fixed in: 1.25



Subject: [PATCH] delay building of stack trace's frames
The latest Devel::StackTrace has code to delay trace processing, however Exception::Class::base calls frame method in its constructor what mkaes all those performance improvements in D::ST useless. This patch delays any frame related calls. -- Best regards, Ruslan.
Subject: EC-1.24-delay_trace_frames_building.patch
Only in Exception-Class-1.24-my/: Makefile Only in Exception-Class-1.24-my/: blib diff -ur Exception-Class-1.24/lib/Exception/Class.pm Exception-Class-1.24-my/lib/Exception/Class.pm --- Exception-Class-1.24/lib/Exception/Class.pm 2008-03-30 21:27:48.000000000 +0400 +++ Exception-Class-1.24-my/lib/Exception/Class.pm 2008-10-21 10:01:42.000000000 +0400 @@ -223,13 +223,26 @@ # Create accessor routines BEGIN { - my @fields = qw( message pid uid euid gid egid time trace package file line ); + my @fields = qw( message pid uid euid gid egid time trace); no strict 'refs'; foreach my $f (@fields) { *{$f} = sub { my $s = shift; return $s->{$f}; }; } + + my %trace_fields = (package => 'package', file => 'filename', line => 'line'); + while (my ($f, $m) = each %trace_fields) + { + *{$f} = sub { + my $s = shift; + return $s->{$f} if exists $s->{$f}; + + my $frame = $s->trace->frame(0); + return $s->{$f} = undef unless $frame; + return $s->{$f} = $frame->$m(); + }; + } *{'error'} = \&message; } @@ -305,13 +318,6 @@ max_arg_length => $self->MaxArgLength, ); - if ( my $frame = $self->trace->frame(0) ) - { - $self->{package} = $frame->package; - $self->{line} = $frame->line; - $self->{file} = $frame->filename; - } - my %fields = map { $_ => 1 } $self->Fields; while ( my ($key, $value) = each %p ) { Only in Exception-Class-1.24-my/: pm_to_blib