[Zope-dev] ape performance

2003-09-08 Thread Seb Bacon
Hi,

I'm trying to use Ape for a photo album - the idea being that I just 
drop new photos where I normally do on the filesystem, and Zope provides 
a thumbnails-bells-and-whistles view onto it.

Performance is extremely poor: viewing the root of the hierarchy causes 
*all* descendent objects to be loaded first (about 3000).

Is there a way I can avoid or mitigate this problem?

seb



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


[Fwd: Re: [Zope-dev] ape performance]

2003-09-08 Thread Christian Theune

Use the object cache, which will keep stuff in memory, so only the first
page view will be slow, the rest should be as-if-filestorage speed.
That's my experience with it.

You can set it by giving the parameter cache_size on the database
factory with the setDatabaseParams method.

Cheers,
Christian
-- 
Christian Theune, gocept gmbh  co. kg
http://www.gocept.com - [EMAIL PROTECTED]
fon: 03496 3099112 fax: 03496 3099118 mobile: 0179 7808366


signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: ape performance

2003-09-08 Thread Shane Hathaway
Seb Bacon wrote:
Hi,

I'm trying to use Ape for a photo album - the idea being that I just 
drop new photos where I normally do on the filesystem, and Zope provides 
a thumbnails-bells-and-whistles view onto it.

Performance is extremely poor: viewing the root of the hierarchy causes 
*all* descendent objects to be loaded first (about 3000).

Is there a way I can avoid or mitigate this problem?
Yes.  Right now, folders are using simple OID references, which means 
that when you load a folder you also have to load a stub for every 
subobject.  If we instead pass (OID, class) tuples to the deserializer, 
it will be much more efficient.

Shane

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] PythonLibraries Product

2003-09-08 Thread Evan Simpson
I'm thinking seriously about writing a Product to provide collections of 
Python functions defined by a single source text -- PythonLibraries. 
This would *not* be the same as Zope 3's persistent modules, although it 
would provide some of the same benefits.

Here's the README.txt:

Python Libraries

  The Python Libraries Product provides support for collections of
  restricted Python code.  A Python Library is similar to a Folder
  full of Python-based Scripts, except that the functions in the
  Library are more like ordinary Python functions than Scripts, and
  a single persistent global variable namespace is shared among the
  functions in the Library.
  A Library obeys the same security restrictions, and has access to
  the same set of modules, as a Script.  Libraries are *not* very
  much like Python modules or packages, except in that they both are
  convenient places to keep groups of functions.  You cannot import
  a Library, define Python classes in one, or use the 'print' statement
  outside of function definitions.
  When changes to a Library are saved, its source code is executed.
  This process, known as Library initialization, also occurs
  whenever the Library is loaded into memory from the ZODB.  Global
  variables defined during initialization are divided into three
  groups, depending on the kind of value to which they refer:
  functions, simple data, and modules.  There is one additional
  global variable, named 'Library', that is defined both during
  initialization and function evaluation, and which cannot be deleted
  or rebound.  It refers to the Library object itself.
  Functions are made available to other Zope code as Library attributes.
  A function 'do_it' contained in the Library located at '/foo/myLib'
  may be called by a TALES expression such as here/foo/myLib/do_it
  or the Python expression context.foo.myLib.do_it().  Function
  names that conflict with methods of the Library object are syntax
  errors.  A Library's functions are not published by default, which
  means that they cannot be accessed by URL through ZPublisher.  There
  is a Library method 'pl_publish()' that can be used to explicitly
  publish a function.
  Simple data includes Python built-in types such as numbers,
  strings, lists, and dictionaries.  Variables with simple data are
  persistent, and their value is retained even when the Library is
  changed or reloaded, although the execution of the code can remove
  or overwrite them.  These variables are not visible to other Zope
  objects.
  Modules are imported Python modules.  These are not visible to
  other Zope objects, and do not persist -- they are re-imported
  each time the Library is changed or loaded.
  Unlike Scripts, Libraries do not have a Bindings tab.  In order to
  access context objects, such as the Library's container, the root
  Zope object, or the authenticated user, functions must use a global
  variable created by a call to the 'pl_bind()' method of the Library.
  This method takes two arguments: a variable name, and a TALES
  expression.  The TALES expression will be evaluated the first time
  that the variable is used in each call to a Library function, and
  the value will be cached for subsequent uses within the same call.
  For example, examine the following snippet of Library code:
Library.pl_bind('user', 'user')
Library.pl_bind('thingy', 'here/thingy | nothing')
def f():
if user.has_role('Authenticated') and thingy is not None:
print user, thingy
return printed
  When the function 'f' is called, the 'user' and 'thingy' variables
  will be evaluated in its first line, and the values will be reused
  in the second line, if the condition is true.  If 'f' is called
  again, in the same request or not, the bound variables will be
  re-evaluated.  Bound variables are not available during Library
  initialization, since they are unlikely to evaluate meaningfully
  when a Library is loaded from the ZODB.
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )