This is the mail archive of the gcc@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]
Other format: [Raw text]

Re: Some GC marking inefficiency with chain_next and chain_prev



On 10/12/2003, at 3:21 AM, S. Bosscher wrote:


In other words, first we go over the next and prev chains because
of the GTY markers "chain_next" and "chain_prev".  Then we look
at those fields again in the loop, calling ggc_set_mark() on the
prev and next fields again, but this has no effect since we've
already marked them.

I noticed this when these options were implemented, but I couldn't see an easy to fix it without parsing the arguments to chain_next and chain_prev and knowing a lot about structure layout. It's not a significant cost, since the data will already be in cache.


If you don't need chain_prev and chain_next, you shouldn't use them. When I tried automatically putting chain_next on every structure that looked like it could use it (*with* the improvement you suggest above, since if it's automatic you know which field doesn't need marking), GC slowed down measurably.


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