This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


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

Re: Speeding up type lookup


>>>>> "Martin" == Martin v Loewis <martin@loewis.home.cs.tu-berlin.de> writes:

    Martin> When profiling gcc, I noticed that a measurable amount of

Cool -- you're profiling.  Most excellent.

    Martin> time is spent in type_hash_lookup. Upon further
    Martin> investigation, I found that this is due to the large
    Martin> number of collisions in the hash table, which requires a
    Martin> deeper analysis of the types to determine equality. In one
    Martin> of my examples, there where 250 types for a single hash
    Martin> bucket; for a trivial 'int main(){}' c++ program, there
    Martin> are up to three collisions.

The right thing to do is to use the new automatically expanding hash
tables in libiberty, and ditch the ad-hoc hash table in tree.c.  That
will solve the problem, even for very large compilations.  Would you
be willing to tackle that instead?

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

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