axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Axiom-developer] 20080217.01.wxh.patch (fix: hash tables to speed compi


From: daly
Subject: [Axiom-developer] 20080217.01.wxh.patch (fix: hash tables to speed compiles)
Date: Sun, 17 Feb 2008 20:25:04 -0600

The last patch uploaded the wrong file. This patch adds the get1 function.

Tim
========================================================================
diff --git a/changelog b/changelog
index dd95712..5323199 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,4 @@
+20080217 wxh src/interp/i-intern.boot upload proper file. 
 20080217 tpd src/algebra/string.spad add function examples
 20080217 tpd src/algebra/curve.spad add function examples
 20080216 wxh src/interp/i-intern.boot use hashtable to speedup compiles
diff --git a/src/interp/i-intern.boot.pamphlet 
b/src/interp/i-intern.boot.pamphlet
index 7520954..9b9c660 100644
--- a/src/interp/i-intern.boot.pamphlet
+++ b/src/interp/i-intern.boot.pamphlet
@@ -739,14 +739,27 @@ get0(x,prop,e) ==
 
 @
 \subsection{get1}
+We try to avoid lookups in the environment if it is clear that
+the lookup will fail. The \verb|$envHashTable| was populated in
+addBinding (see g-util.boot.pamphlet).
 <<*>>=
 get1(x,prop,e) ==
     --this is the old get
+  negHash := nil
   null atom x => get(QCAR x,prop,e)
+  if $envHashTable and _
+     (not(EQ($CategoryFrame,e))) and _
+     (not(EQ(prop,"modemap"))) then
+   null (HGET($envHashTable,[x,prop])) => return nil
+   negHash := false
   prop="modemap" and $insideCapsuleFunctionIfTrue=true =>
-    LASSOC("modemap",getProplist(x,$CapsuleModemapFrame))
-      or get2(x,prop,e)
-  LASSOC(prop,getProplist(x,e)) or get2(x,prop,e)
+    ress:=LASSOC("modemap",getProplist(x,$CapsuleModemapFrame))
+         or get2(x,prop,e)
+    ress
+  ress:=LASSOC(prop,getProplist(x,e)) or get2(x,prop,e)
+  if ress and negHash then
+   SAY ["get1",x,prop,ress and true]
+  ress
 
 @
 \subsection{get2}




reply via email to

[Prev in Thread] Current Thread [Next in Thread]