Skip Menu |

This queue is for tickets about the MooseX-Storage CPAN distribution.

Report information
The Basics
Id: 96426
Status: new
Priority: 0/
Queue: MooseX-Storage

Owner: Nobody in particular
Requestors: Mario.Paumann [...]

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

CC: Gortan Philipp <philipp.gortan [...]>, Eder Christian <Christian.Eder [...]>
Subject: engine_traits performanceflaw
Date: Fri, 13 Jun 2014 11:38:35 +0000
To: "bug-MooseX-Storage [...]" <bug-MooseX-Storage [...]>
From: Paumann Mario <Mario.Paumann [...]>
Download (untitled) / with headers
text/plain 941b
Hi ! We're using our own Storage traits with large ArrayRef of Moose Classes. We're used your Traits (e.g. as an example which shows : $args{engine_traits} ||= []; push(@{$args{engine_traits}}, 'OnlyWhenBuilt'); $self->$orig(%args); This leads to performance problems due to the nature the %args of pack is 'arounded'. The following solved the problem : $self->$orig( %args, engine_traits => [ @{ $args{engine_traits} || [] }, 'PreserveUndef' ]); Explanation : For every Moose Object in the ArrayRef to be packed the the engine_traits List is extended because the %args ist _modified_ and so the @args of [ map { blessed($_) ? $OBJECT_HANDLERS{collapse}->($_, @args) : $_ } @$array ] Is modified too. If you find this useful you should modify your Traits the same way or maybe you have a better idea. Thank you, Mario

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to