BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

speed penalties

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OO design
View previous topic :: View next topic  
Author Message
David Novo
Guest





PostPosted: Thu Dec 08, 2005 7:22 pm    Post subject: speed penalties Reply with quote



Hello,

It seems that "better design" seems to involve creating lots of little
objects that help with different things. Instead of hard coding stuff,
and creating descendants with large inheritance trees, you encapsulate
the variation within objects.

I am just wondering, is there a potential of speed penalties in this
regard. I can forsee that even for basic things, we are going to be
creating many more objects/interfaces and passing them around and then
freeing them.

Is this a realistic issue that comes up and we should be aware of it,
or for all intents and purposes it doesn't happen?

Thanks,
Dave
Back to top
Iman L Crawford
Guest





PostPosted: Thu Dec 08, 2005 8:35 pm    Post subject: Re: speed penalties Reply with quote



"David Novo" <dave (AT) xxx (DOT) denovosoftware.xyz.com> wrote in news:439895fc$1
@newsgroups.borland.com:
Quote:
Is this a realistic issue that comes up and we should be aware of it,
or for all intents and purposes it doesn't happen?

I think this is a valid concern. When it becomes a concern will most
likely be application specific.

--
Iman



Back to top
Bob Dawson
Guest





PostPosted: Thu Dec 08, 2005 10:58 pm    Post subject: Re: speed penalties Reply with quote



"David Novo" wrote
Quote:

It seems that "better design" seems to involve creating lots of little
{...]


In general I'd agree with that, and not just at the object level. I find
myself looking suspiciously at any method that doesn't fit in a normal edit
window.

Quote:
I am just wondering, is there a potential of speed penalties in this
regard.

Potentially, but not generally. At the speed of today's processors, basic
memory allocation and release operations are pretty fast. And the new memory
manager in D2006 is supposed to be better specifically with this pattern of
memory usage (also multi-threading. IIRC).

bobD



Back to top
Jim Cooper
Guest





PostPosted: Thu Dec 08, 2005 11:12 pm    Post subject: Re: speed penalties Reply with quote


Quote:
Is this a realistic issue that comes up and we should be aware of it,

Yes, to a point. However, may programmers suffer from premature optimisation,
spending ages speeding up code that just doesn't matter.

Write the code first, profile afterwards. You may be surprised what
inefficiencies you can get away with :-)

The upside of many small methods (the number of classes is less important for
this) is that profiling then tends to be more specific. It's almost always
easier to work out how to speed up 5 lines of code than 50.


Cheers,
Jim Cooper

__________________________________________

Jim Cooper [email]jcooper (AT) tabdee (DOT) ltd.uk[/email]
Skype : jim.cooper
Tabdee Ltd http://www.tabdee.ltd.uk

TurboSync - Connecting Delphi to your Palm
__________________________________________

Back to top
Gerrit Beuze
Guest





PostPosted: Fri Dec 09, 2005 7:37 am    Post subject: Re: speed penalties Reply with quote

Quote:
Is this a realistic issue that comes up and we should be aware of it,
or for all intents and purposes it doesn't happen?

Yes, it is an issue, but the performance issue usually appear in places where you did not expect it.
My experience is that one should focus on the correct design - and yes, that in some cases involves
lots of little objects. And only if there's a performance problem use a profiler to find bottlenecks.
I have more than once found that I was worried about performance after some re-design
that involved yet more small objects - but no customer ever complained.

For example: when profiling ModelMaker Code Explorer it turned out that
I could gain lots in places where I had never expected it. And it was quite easy to
find a different approach, leaving the design intact.

For a good profiler: check AutomatedQA's AQTime. It does profiling without
instrumenting source code + comes with lots of different profilers.

Gerrit Beuze
ModelMaker Tools



Back to top
David Novo
Guest





PostPosted: Sat Dec 10, 2005 12:10 am    Post subject: Re: speed penalties Reply with quote

Thanks for all the comments! We already do use AQTime, which I agree
with Gerrit is an excellent product, but probably not as often as we
should.

Then again, we don't refactor as often as we should...
update the documentation as often as we should....
make test cases as often as we should.....
take vacation as often as we should :-)

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OO design All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.