[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: C++
From: |
Arne Babenhauserheide |
Subject: |
Re: C++ |
Date: |
Thu, 24 Sep 2009 13:49:48 +0200 |
User-agent: |
KMail/1.12.1 (Linux/2.6.30-gentoo-r5; KDE/4.3.1; x86_64; ; ) |
Am Donnerstag, 24. September 2009 12:52:13 schrieb Sam Mason:
> I've written application code that was 30 times faster when it was
> written in C (i.e. lots of arrays) vs. C++ (with a nice easy to
> understand class hierarchy).
That's the same optimization people in the gaming industry use(-d?) for tiles:
just go for simple arrays - your program knows where to break them, and they
save you the precious extra processing time and memory you need for all those
other nifty effects :)
But then that isn't about C++ vs. C, it's about how to most efficiently
represent your data in memory. And for many access patterns an array is simply
the fastest way.
And if you need massive performance, you should naturally forgo readability.
But these arrays are damn error prone and hard to unerstand.
Many things don't need as much performance, though. I wouldn't bother to write
a level-reader for a game in C, even though I might have to use C for graphics
code. Reason: The level is read once and is disk-bound. Graphics are needed
all the time (essentially a while loop).
Best wishes,
Arne
--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
- singing a part of the history of free software -
http://infinite-hands.draketo.de
signature.asc
Description: This is a digitally signed message part.
- Re: C++, (continued)
- Re: C++, Bahadir Balban, 2009/09/24
- Re: C++, Jonathan S. Shapiro, 2009/09/24
Re: Broken dream of mine :(, arnuld uttre, 2009/09/17
C++ (was: Broken dream of mine :( ), olafBuddenhagen, 2009/09/23
- Re: C++, Bas Wijnen, 2009/09/23
- Re: C++, Tom Bachmann, 2009/09/23
- Re: C++, Jonathan S. Shapiro, 2009/09/23
- Re: C++, Tom Bachmann, 2009/09/24
- Re: C++, Michal Suchanek, 2009/09/24
- Re: C++, Sam Mason, 2009/09/24
- Re: C++,
Arne Babenhauserheide <=
- Re: C++, Sam Mason, 2009/09/24
- Re: C++, Lluis, 2009/09/24
- Re: C++, Bas Wijnen, 2009/09/24
- Re: C++, Jonathan S. Shapiro, 2009/09/24
- Re: C++, Arne Babenhauserheide, 2009/09/25
Re: C++, Jonathan S. Shapiro, 2009/09/24
Re: C++, Bas Wijnen, 2009/09/25
Re: Broken dream of mine :(, Arne Babenhauserheide, 2009/09/16