[python-win32] Re: Object access in ASP

Don Dwiggins dond@advancedmp.com
04 Dec 2002 16:45:43 -0800


Brian Brown writes:
> Please help me understand some things about the environment if you can :)

> From what I understand, the ActiveX Scripting Engine caches the python
> interpreter; if so, then objects should stay around between page accesses,
> right? If so, is there any way to get access to instantiated objects? You
> can't store them in Session variables, so I don't know how else you would
> do it... I believe that I would also have to handle concurrent accesses to
> my objects... but that is another issue ;)

Objects don't stick around (they live in an execution context that
disappears when the page execution is done), but if you import modules,
they'll stay loaded in the interpreter between requests (which is a minor
pain for debugging, of course, but a win for production).

> Any thoughts? If I can access instantiated object between page accesses,
> then performance could be dramatically increased (not that its bad) and
> Session vars could probably be eliminated from an ASP perspective.

There are many ways to avoid rebuilding objects on new requests; all have
tradeoffs and complications.  I'd avoid getting into that until you've done
enough stress testing and profiling to know where the bottlenecks are.

HTH,
-- 

Don Dwiggins                     "The truth will make you free,
d.l.dwiggins@computer.org         but first it will make you miserable"
                                  -- Tom DeMarco