Re: Benchmark: STL's list vs. hand-coded one
- From: Mark Borgerson <mborgerson@xxxxxxxxxxx>
- Date: Fri, 23 Nov 2007 11:50:00 -0800
In article <qi8ek3l0b7shp51a6vgfm036ll43h283i9@xxxxxxx>,
nospam@xxxxxxxxxxxxxx says...
Mark Borgerson <mborgerson@xxxxxxxxxxx> wrote:
In article <easdk3ts6v2hloabfe3n7s9b1qh1b7ruu0@xxxxxxx>,
nospam@xxxxxxxxxxxxxx says...
Mark Borgerson <mborgerson@xxxxxxxxxxx> wrote:
And having 64MB buffer allocated you will need to write your own new(),
free(), or malloc() implementations to manage memory in the buffer and do
you *know* they are going to be more efficient than the library and OS code
you are avoiding?
Hmmm, can you tell me how
myptr = malloc(UNITSIZE1);
can be more efficient than
myptr1 = &bigbuf(Endptr);
Endptr += UNITSIZE1;
Hmm, if you bother to check the pointer from malloc or use new() and throw
an exception when you meet a big enough program instead of producing
garbage or crashing would that be more efficient?
"Big enough program"??? Have you ever seen a program that would need
more than one million symbol table entries of 64 bytes each?
If that isn't enough, spend another $100 on RAM and increase the
buffer to 640MBytes.
To support your efficient memory management you limit symbol size to
something significantly less that 64 characters? What about debug
information? What about tags support requiring all symbol references to be
stored? What about all the other memory a compiler needs? Function and data
structure definitions, call trees for register tracking, optimisation
structures etc, etc, etc are you going to allocate 64 (or 640)MB big
buffers for all these too?
Sure---why not. I see no particular problem with 10 separate 64MByte
buffers, one for each function.
If limiting symbol names to 64 bytes is a problem, just double the
size for that buffer and limit the size to 128 bytes. Or you
could just allocate room for 512,000 symbols of 256 bytes--similar
to the decorated symbol names used in VC++.
In any case, there's no reason the compiler should crash or produce
garbage with your hypothetical large program. The program can
certainly keep track of the number of symbol table entries used
and throw an exception as easily as you could with malloc().
Yes you could require the compiler (and programmer writing it) to jump
through hoops to make up for deficiencies in the memory management system
you are suggesting,
I don't see the deficiencies being any more annoying than those inherent
in malloc() and free(), but then I don't write compilers, but do write
application programs for embedded systems. There, the problems with
malloc() are more significant.
Mark Borgerson
.
- References:
- Re: Benchmark: STL's list vs. hand-coded one
- From: Wilco Dijkstra
- Re: Benchmark: STL's list vs. hand-coded one
- From: Jyrki Saarinen
- Re: Benchmark: STL's list vs. hand-coded one
- From: Wilco Dijkstra
- Re: Benchmark: STL's list vs. hand-coded one
- From: Mark Borgerson
- Re: Benchmark: STL's list vs. hand-coded one
- From: Everett M. Greene
- Re: Benchmark: STL's list vs. hand-coded one
- From: Mark Borgerson
- Re: Benchmark: STL's list vs. hand-coded one
- From: nospam
- Re: Benchmark: STL's list vs. hand-coded one
- From: Mark Borgerson
- Re: Benchmark: STL's list vs. hand-coded one
- From: nospam
- Re: Benchmark: STL's list vs. hand-coded one
- From: Mark Borgerson
- Re: Benchmark: STL's list vs. hand-coded one
- From: nospam
- Re: Benchmark: STL's list vs. hand-coded one
- Prev by Date: Re: Benchmarks: STL's string vs. C string
- Next by Date: Re: Benchmarks: STL's string vs. C string
- Previous by thread: Re: Benchmark: STL's list vs. hand-coded one
- Next by thread: Re: Benchmark: STL's list vs. hand-coded one
- Index(es):
Relevant Pages
|