From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Berlin To: Andrew Cagney Cc: Daniel Berlin , gdb-patches@sources.redhat.com, Jim Blandy Subject: Re: PATCH: fail to improve psymtab memory consumption Date: Tue, 24 Jul 2001 09:47:00 -0000 Message-id: <87n15ugtph.fsf@cgsoftware.com> References: <20010720212013.7DA695E9D8@zwingli.cygnus.com> <87lmljdz4g.fsf@cgsoftware.com> <87d76uerh8.fsf@cgsoftware.com> <3B5CD3B6.9060106@cygnus.com> <87zo9uaow2.fsf@cgsoftware.com> <3B5D85C3.1000104@cygnus.com> X-SW-Source: 2001-07/msg00599.html Andrew Cagney writes: >>> Does this require serial or random file i/o? >> ... you could make fread use mmap >> in special cases, but they don't happen enough in practice to make >> fread fast enough to beat mmap. > > > It may not happen enough to ``beat mmap'', it certainly happens enough > to justify the implementation of FILE using V/M based schema. Err, what? You must not have looked at most pieces of software that access disk these days. Most use mmap when possible. > > Anyway, that isn't the objective. The objective is to get the dwarf2 > reader clean simple and pragmatically fast. Fast, at all cost, is > like micro-optomizing using STREQ() macros. Which i'm opposed to completely, and you know this (I replaced quite a few when a lot of STREQ->strcmp_iw changes went in, instead of STREQ->STREQ_IW) Comparing using MMAP to micro-optimizing is trivializing it in the extreme. If you really think it's a micro optimization, once again, I invite you to *try* it. >If you think there should > be a mmap implementation then abstract it out so that dwarf2 uses it > rather than contains it. It does. If configure says we have MMAP, we use MMAP. What's the problem? Where do you think this abstraction should take place? BFD? > > If you think there should be MMAP, then get it added to BFD where all > readers will benefit, not just DWARF2. This is tricky, because of the hell that is BFD. Apple's tried it, i've tried it, etc. Because of hacks and kludges for in-memory stuff in BFD, it breaks things. > > > Andrew -- "I like to go to art museums and name the untitled paintings... Boy With Pail... Kitten On Fire. "-Steven Wright