[Seaside] Getting profiling info from Seaside in a VW
renggli at gmail.com
Sat Jan 28 10:29:45 CET 2006
> > Since I am currently working on the VW port of 2.6a2 I had a look
> > to the profiling feature. It's quite easy to integrate and it will
> > be included in the next port.
> > A question though.
> > I noticed that profiling is only available for the rendering phase.
> > Sure, this is useful, but not as quite useful as profiling the
> > callback
> > phase. Has anything tried for profiling the callback phase ?
> It's actually harder to do than you would think, because often the
> callback phase involves the invocation of one or more continuations -
> which means that the stack is really messy. Squeak's profiler,
> anyway, doesn't have an easy time with that. I agree that it would
> be very useful, however, if someone finds a clever way to do it.
I have written a decorator that logs a lot of interesting information
(in an extended common-log format) for the rendering and the
callback-phase, this includes simple profiling information. For the
callbacks I had to do some fancy continuation tricks, but it works.
The relevant piece of code is the one below (ugly):
| timing continuation |
timing := Time millisecondClockValue.
continuation := self session instVarNamed: 'escapeContinuation'.
self session instVarNamed: 'escapeContinuation' put: [ :value |
logRequest: self session currentRequest nativeRequest
response: value kind: #callback
time: Time millisecondClockValue - timing.
continuation value: value ].
^super processCallbackStream: aStream.
The timing is not entirely correct, but I guess it should give a
figure somewhere close to the real value. If necessary I can publish
the whole code, but I have to negotiate with netstyle.ch first ;-)
More information about the Seaside