This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


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

Re: gc.c question


dirk@ida.ing.tu-bs.de writes:
> On Mon, 29 May 2000, Han-Wen Nienhuys wrote:
> 
> > I was looking over gc.c yesterday, and I don't get it: what is the
> > difference between SCM_GCMARKP() and SCM_GC8MARKP ()?
> 
> The difference is that SCM_GCMARKP checks the CDR cell element, while
> GC8MARKP checks the CAR cell element.  Since gc runs over a large number
> of cells, the effort per cell has to be minimized.  Since for some scheme
> type only either SCM_GCMARKP or SCM_GC8MARKP has to be checked, this check
> is postponed to a point where the cell type is known.
> 
> Your solution would be a performance improvement for the case that it is
> very probable to detect an already marked cell during gc.  Then, your

Oh, that is not what I meant. I just felt that the code was too long
(and unreadable), and shorter code tends to be better for cache. I was
thinking that


	 if (CASE1P)
	 {
		if (SCM_GCMARKP(ptr))
		   return;

		[case-1-switch]
	 } else if (CASE2P)
	 {
		if (SCM_GC8MARKP(ptr))
		   return;

		[case-2-switch]
	 }

would work just as fast, and result in smaller object code.  It's just
that I lack the innate knowledge of GUILE's tags to think what CASE1P
and CASE2P would be
 
-- 

Han-Wen Nienhuys, hanwen@cs.uu.nl ** GNU LilyPond - The Music Typesetter 
      http://www.cs.uu.nl/people/hanwen/lilypond/index.html 


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