[Seaside] WARegistry performance

Balázs Kósi rebmekop at gmail.com
Sat Dec 13 22:35:40 UTC 2008


We've tested our seaside (2.8) application with ab [1] and found that
the performance decreases with repeated runs of the benchmark.
Ab creates a new session for every request, so we've looked into the
session handling code and found that WARegistry spends O(n)
time with housekeeping for every new session, where n is the number of
registered sessions. This means that creating n sessions rapidly
takes O(n^2) time.

SeasideRegistry-ul.3.mcz [2] contains an alternative approach which
needs O(n) time for n new sessions, amortized O(1) time for every
We use a LinkedDictionary, which is a combination of a dictionary and
a linked list. In the list handlers are sorted by expiration time.
Every time
a new session is created we unregister all the expired sessions, which
can be found at the beginning of the list. When a session is accessed
then we move it to the end of the list.

To try it out you need to load HashTable from [3] first.

counter_benchmark.pdf [4] contains some benchmarks created with
autobench [5]. We used Seaside-2.8-578 one-click image. Set the
size to 100 in TcpListener. Some graphs can be found at [6].

What do you think?

Cheers, Levente and Balázs

[1] Apache HTTP server benchmarking tool:
[2] http://leves.web.elte.hu/linkeddictionary/SeasideRegistry-ul.3.mcz
[3] HashTable ss repo: http://www.squeaksource.com/ht.html
[4] http://leves.web.elte.hu/linkeddictionary/counter_benchmark.pdf
[5] http://www.xenoclast.org/autobench/
[6] http://leves.web.elte.hu/linkeddictionary/

More information about the seaside mailing list