[Commits] (pje) Spike: update code generator test to use Andi's new "viewless items". This

commits at osafoundation.org commits at osafoundation.org
Thu Apr 14 20:49:55 PDT 2005


Commit by: pje
Modified files:
internal/Spike/src/spike/codegen.txt 1.2 1.3

Log message:
Spike: update code generator test to use Andi's new "viewless items".  This 
drops the test's runtime from 1.3 seconds to .8 seconds - a full half 
second, a speedup of almost 40%.  This is also my first experiment with 
creating schema in the null view, which is a prerequisite for implementing
a Python schema API atop the repository.


ViewCVS links:
http://cvs.osafoundation.org/index.cgi/internal/Spike/src/spike/codegen.txt.diff?r1=text&tr1=1.2&r2=text&tr2=1.3

Index: internal/Spike/src/spike/codegen.txt
diff -u internal/Spike/src/spike/codegen.txt:1.2 internal/Spike/src/spike/codegen.txt:1.3
--- internal/Spike/src/spike/codegen.txt:1.2	Mon Feb 14 14:07:35 2005
+++ internal/Spike/src/spike/codegen.txt	Thu Apr 14 20:49:54 2005
@@ -11,17 +11,14 @@
 2. Assist in the translation of existing Chandler content types to use the
    Spike API.
 
-Before we can do anything useful, we'll need to set up a Chandler repository
-instance::
+Before we can do anything useful, we'll need to import the Chandler
+repository's "null view", and populate it with the repository schema and
+Chandler core schema::
 
+    >>> from repository.persistence.RepositoryView import nullRepositoryView
+    >>> rep = nullRepositoryView
     >>> import os, repository
     >>> packdir = os.path.join(os.path.dirname(repository.__file__),'packs')
-    >>> from repository.persistence.DBRepository import DBRepository
-    >>> rep = DBRepository('__repository__')
-    >>> rep.create(ramdb=True)
-
-And then load in the repository schema and Chandler base schema::
-
     >>> rep.loadPack(os.path.join(packdir,'schema.pack'))
     >>> rep.loadPack(os.path.join(packdir,'chandler.pack'))
 



More information about the Commits mailing list