Re: No need to optimize in assembly anymore
From: Bryan Parkoff (bryan.nospam.parkoff_at_nospam.com)
Date: 05/23/04
- Next message: Axel Schlicht: "Re: i86, AT&T syntax, GNU as"
- Previous message: Matt Taylor: "Re: No need to optimize in assembly anymore"
- In reply to: Matt Taylor: "Re: No need to optimize in assembly anymore"
- Next in thread: Ivan Korotkov: "Re: No need to optimize in assembly anymore"
- Reply: Ivan Korotkov: "Re: No need to optimize in assembly anymore"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 23 May 2004 02:10:12 +0000 (UTC)
Matt,
Okay, do you claim that variables and functions inside classes are
better than container classes and STL? You would want to avoid malloc or
new function if it is less than 1MB. It is not really necessary to use
malloc or new functions if memory is not very big.
What is the minimum MB that malloc or new function should be used? I
suspect 10MB.?????
Is it true that malloc or new function is never used if segments are
used instead of flat model under 640KB? It sounds like malloc or new
function uses to allocate virtual memory, but below 640KB does not. Correct
me if I am wrong.
-- Bryan Parkoff "Matt Taylor" <para@tampabay.rr.com> wrote in message news:_KRrc.19466$Ol3.15521@twister.tampabay.rr.com... > "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: Axel Schlicht: "Re: i86, AT&T syntax, GNU as"
- Previous message: Matt Taylor: "Re: No need to optimize in assembly anymore"
- In reply to: Matt Taylor: "Re: No need to optimize in assembly anymore"
- Next in thread: Ivan Korotkov: "Re: No need to optimize in assembly anymore"
- Reply: Ivan Korotkov: "Re: No need to optimize in assembly anymore"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|