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]

[knotwell@f5.com] Re: [PATCH] Re: startup speed (or lack thereof)


------- Start of forwarded message -------
From: knotwell@f5.com
Message-ID: <14550.35846.412325.295899@knotwell.f5.com>
Date: Mon, 20 Mar 2000 12:37:26 -0800 (PST)
To: Jim Blandy <jimb@red-bean.com>
Subject: Re: [PATCH] Re: startup speed (or lack thereof)


Hi Jim--

I spent some time in symbols.c (specifically,scm_intern_obarray_soft).  I 
made some small changes that make the code a bit easier to understand
while providing a slight optimization. 

BTW:  I'd mail the guile-list but it doesn't like our mail server.

--Brad

*** symbols.c.orig	Mon Mar 20 10:12:47 2000
--- symbols.c	Mon Mar 20 12:35:18 2000
***************
*** 230,236 ****
  scm_intern_obarray_soft (const char *name,scm_sizet len,SCM obarray,int softness)
  {
    SCM lsym;
-   SCM z;
    register scm_sizet i;
    register unsigned char *tmp;
    scm_sizet scm_hash;
--- 230,235 ----
***************
*** 248,278 ****
  
    scm_hash = scm_strhash (tmp, i, SCM_LENGTH(obarray));
  
-   /* softness == -1 used to mean that it was known that the symbol
-      wasn't already in the obarray.  I don't think there are any
-      callers that use that case any more, but just in case...
-      -- JimB, Oct 1996  */
-   if (softness == -1)
-     abort ();
- 
   retry_new_obarray:
    for (lsym = SCM_VELTS (obarray)[scm_hash]; SCM_NIMP (lsym); lsym = SCM_CDR (lsym))
      {
!       z = SCM_CAR (lsym);
!       z = SCM_CAR (z);
!       tmp = SCM_UCHARS (z);
!       if (SCM_LENGTH (z) != len)
  	goto trynext;
!       for (i = len; i--;)
  	if (((unsigned char *) name)[i] != tmp[i])
! 	  goto trynext;
!       {
! 	SCM a;
! 	a = SCM_CAR (lsym);
! 	SCM_REALLOW_INTS;
! 	return a;
!       }
!     trynext:;
      }
  
    if (obarray == scm_symhash)
--- 247,269 ----
  
    scm_hash = scm_strhash (tmp, i, SCM_LENGTH(obarray));
  
   retry_new_obarray:
    for (lsym = SCM_VELTS (obarray)[scm_hash]; SCM_NIMP (lsym); lsym = SCM_CDR (lsym))
      {
!       SCM a = SCM_CAAR(lsym);
!       if (SCM_LENGTH(a) != len) 
  	goto trynext;
! 
!       tmp = SCM_UCHARS(a);
!       for(i=len;i--;)
  	if (((unsigned char *) name)[i] != tmp[i])
! 	  goto trynext; 
! 
!       a = SCM_CAR(lsym);
!       SCM_REALLOW_INTS;
!       return a;
! 
!       trynext:;
      }
  
    if (obarray == scm_symhash)

------- End of forwarded message -------

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