Re: No need to optimize in assembly anymore
From: Matt Taylor (para_at_tampabay.rr.com)
Date: 05/23/04
- Next message: Bryan Parkoff: "Re: No need to optimize in assembly anymore"
- Previous message: Matt Taylor: "Re: i86, AT&T syntax, GNU as"
- In reply to: Bryan Parkoff: "Re: No need to optimize in assembly anymore"
- Next in thread: Bryan Parkoff: "Re: No need to optimize in assembly anymore"
- Reply: Bryan Parkoff: "Re: No need to optimize in assembly anymore"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 23 May 2004 00:12:16 +0000 (UTC)
"Bryan Parkoff" <bryan.nospam.parkoff@nospam.com> wrote in message
news:H%prc.9302$Hh.4606@fe1.texas.rr.com...
> Matt,
>
> I don't understand your point. You state that container classes or
just
> classes are slower than structs. If it is true that many assembler
> programmers and C (not C++) programmers are sticking with structs because
> they think that it can increase the performance better than classes. Is
it
> true?
<snip>
I am criticizing the *universal* use of container classes. I am saying that
std::vector is acceptable in some cases, but in other cases it is better to
create an array of 5 elements on the stack. (Aside: the one thing I do
dislike about STL containers is that they use C++ exception handling. With
MSVC, this results in bloated code.)
It is like the example I gave:
// ...
char *buf = new char[256];
FILE *fp;
sprintf(buf, "%s%s", path, filename);
fp = fopen(buf, "rb");
delete[] buf;
// ...
This code could be rewritten like this:
// ...
char buf[256];
FILE *fp;
sprintf(buf, "%s%s", path, filename);
fp = fopen(buf, "rb");
// ...
Fast code should avoid malloc & new whenever possible.
-Matt
- Next message: Bryan Parkoff: "Re: No need to optimize in assembly anymore"
- Previous message: Matt Taylor: "Re: i86, AT&T syntax, GNU as"
- In reply to: Bryan Parkoff: "Re: No need to optimize in assembly anymore"
- Next in thread: Bryan Parkoff: "Re: No need to optimize in assembly anymore"
- Reply: Bryan Parkoff: "Re: No need to optimize in assembly anymore"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|