Skip Menu |

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

Report information
The Basics
Id: 35991
Status: new
Priority: 0/
Queue: Class-Std

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

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: moved checking for existing _hierarchy of into DEST (patch)
Date: Mon, 19 May 2008 02:06:39 +0200
To: bug-Class-Std [...] rt.cpan.org
From: MKUTTER <MKUTTER [...] cpan.org>
Hi Dan, Class::Std's DESTROY uses a call to _hierarchy_of() to determine the inheritance hierarchy of a class. However, when _hierarchy_of is called a second time, a cached value is returned. As the %_hierarchy of hash is defined with package scope, this results in an extraneous method call for the second and all subsequent objects of a class being destroyed. The attached patch addes a test for the existance of a entry in % _hierarchy_of to DESTROY to avoid unneccessary method calls during destruction. A quick benchmark (also attached) shows around 10% speed gain. Sorry for me being to stupid to email directly via git, Martin

Message body is not shown because sender requested not to inline it.

Message body is not shown because sender requested not to inline it.