develooper Front page | perl.moose | Postings from November 2011

Re: hash of objects inside an instance

Thread Previous | Thread Next
From:
Erik Colson
Date:
November 29, 2011 04:28
Subject:
Re: hash of objects inside an instance
Message ID:
8E863ECA-569B-45CF-9936-6A8F46B44BAF@ecocode.net

On 29 Nov 2011, at 13:05, Tomas Doran wrote:

> 
> On 29 Nov 2011, at 11:39, Erik Colson wrote:
>> 
>> Here's some data. The testscript is added below. Results are as expected...
> 
> 
> Yes, my point is entirely demonstrated, which is what I expected :D
> 
> It takes you 4.4 seconds to construct 40000 new employees, with 5 departments each...
> 
> And in real code, you're going to do that how often?
> 
> Assuming it's 100 or so in more real cases (for a screen full of data), then you are going to spend 11 miliseconds constructing these objects..
> 
> So it doesn't matter if one approach is slower than the other - as it just doesn't matter! The actual time spent here is going to be so insignificant (compared to the rest of your application, which of course you haven't timed or showed) as to make no difference, even if it's 3 times more expensive.
> 
> Cheers
> t0m
> 

yep,

The script will create around 2000 employees and 25 departments, with 1 employee being accounted for (actually) max 8 departments.
and that's why I did implement it the 'proper' way ;)
--
erik
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