This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: PATCH: fail to improve psymtab memory consumption


On Jul 24,  1:15am, Daniel Berlin wrote:

> If you look at the code, you'll note this is a perfectly fair
> benchmark, since i'm not pulling any tricks, just using a different
> method of getting a memory buffer for a part of a section (With mmap,
> it mmap's it, without it, it fread's it).

I've always been a fan of mmap().  As Dan has pointed out, there can
be several different performance wins (faster, uses less memory)
associated with using it.

However, one of the problems with mmap() is that it's not terribly
portable.  Most unices these days will have it, but some might have
buggy implementations or take slightly different sets of options. 
Also, those systems which don't have mmap frequently have something
comparable.  The point that I'm driving towards is that if we're going
to use mmap(), I think it would be best if we provide a layer above it
so that all of the nasty "#ifdef HAVE_MMAP" baggage can be hidden away
in one place.  This layer will attempt to use mmap() or equivalent
facilities, but failing that, it'll simply read() into a suitably
sized buffer...

Kevin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]