[Seaside-dev] Issue 262 in seaside: Creating a new session is O(n)

codesite-noreply at google.com codesite-noreply at google.com
Fri Dec 26 08:06:57 UTC 2008


Status: New
Owner: ----
Labels: Type-Feature Priority-Low

New issue 262 by philippe.marschall: Creating a new session is O(n)
http://code.google.com/p/seaside/issues/detail?id=262

When a new session is created, all sessions are iterated over and checked
whether they're still active. This effectively makes creating a new session
O(n), where n is the total number of session. In practice the scanning code
is executed only for every tenth new session, however this doesn't make it
any faster and O(n/10) is still equivalent to O(n).

The suggested solution is to additionally have the sessions in a linked
list ordered by access time. The session dictionary holds to the node so
that upon access in can efficiently be moved to the end of he list. Upon
session creating the start of the list is scanned only until a session is
encountered who is not yet expired.
Additionally a open hashtable can be used to overcome issues with the
Squeak closed hashtable (Dictionary).

Implementation notes:
It should be possible to still have sessions with a custom, higher
lifetime. So the abort condition for scanning should be slightly relaxed.

Depending on the hashtable package is not an option. If you want this
functionality extract the Hashtable class, remove all not needed methods
(that should be most of them) and prefix it WA*. Also check if other
dialects, they might have Dictionary classes that don't have the same
issues as Squeak so they might want to use their own. This might especially
be the case for GemStone.

http://www.nabble.com/WARegistry-performance-td20995160.html
http://www.nabble.com/WARegistry-performance-td21020361.html


--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings


More information about the seaside-dev mailing list