[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Fenfire-dev] Proposed change to VobCoorder.RenderInfo

From: Matti Katila
Subject: Re: [Fenfire-dev] Proposed change to VobCoorder.RenderInfo
Date: Wed, 7 Jul 2004 16:25:18 +0300 (EEST)

On Wed, 7 Jul 2004, Benja Fallenstein wrote:
> Matti Katila wrote:
> | Just one thing. It may use more memory and efficiency resources
> | because of the change?
> Nope. We're doing slightly less work than before: before, we'd do a
> method call (getExtRect(Rectangle)) that would read some instance
> variables (of the RenderInfo) and then change some instance variables

No, I mean the other point of view. Where is the "new RenderInfo", i.e., 
where is it created and how many times? Creating a bigger object takes 
more to gc and longer time to construct. I just had a cold feeling in 
my back that this RenderInfo is created for every coordinate system but I 
have not looked the code so you might have a better knowledge about it.

> (of the Rectangle passed to getExtRect()). After getExtRect() returned,
> we would then read the instance variables from that Rectangle.

It's cheap because it's the key of OO. I hope the language designers have 
though of it at least (as in, "don't count function calls in FO").

> However, even if it was more work, remember rule #1 of writing efficient
> programs: Profile, find the bottlenecks, and fix them.

Yes, iff the design is good enough.

> Don't "optimize" prematurely

Write clean code, don't optimize prematurely :)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]