Hey all, I got a question according to performance of extension I am
working on, it's called Online Status Bar (source is in trunk/extensions/),
this extension is supposed to display status of users, who have it enabled
in preferences, somewhere on userspace (talk, userpace, etc.)
The current design of feature is that:
there is a table which has two columns, username, timestamp it is using as
engine memory because I believe it would work faster. (however I am not a
dba, so I don't know if it has significant performace improvement)
Users who do not have this enabled in preferences do never update this
table so I think there shouldn't be problem, however:
Users who have it enabled - everytime when they open any page on wikipedia,
it look up if they are present in the table (select using their username),
if it returns nothing, it insert them to table (1 write), if they are
present, it compare timestamp with current time and variable which contains
write-delay, it's 5 minutes as default and thanks to that, the table is
updated only in worst case every 5 minutes, or later (so if user refresh a
page like twice a minute it should only do 2 selects, no write), however
every 5 minutes it should write to that status table (update timestamp).
If someone open a userpage of that user, it should do max 2 selects in
order to detect the online status. (in case that user who look up the
status has also this feature enabled, otherwise 1 select)
The table is also supposed to be periodicaly cleaned (expired records), so
it's supposed to be very small.
So, does anyone have any suggestion to make it even faster? Ian Baker told
me that there could be some use of cache, however I am not really sure how
to implement it, what do you think about this conception, is there any way
to make it simpler and keep its functionality as it is?
I don't know if this is a correct place to ask, I don't know if there is
some mediawiki forum where I could ask which would be more suitable.