I'll be participating in the CodeFest project here in Montreal this
weekend (Saturday and Sunday).
http://www.codefest.ws/
Codefest is a weekend hacking event where people who love to code get
together in a room with good wifi and easily-accessible coffee, beer,
and food and just hack like crazy. I've done two other such events here
in Montreal, and they were great. A big chunk of Laconica was written at
Codefest 2.1.
I'd like to invite interested people here to participate either locally
(if you're in town) or remotely on the #laconica channel on
freenode.net. It might be a fun time to have some co-hacking for
everyone involved. The theme of the weekend is optimization and unit
testing, and I see a couple of possible big projects to work on.
* I've done a lot of work in the last few days using memcached to
reduce the number of database hits. The automated caching only
works with tables that have a single-column primary key,
however. I'd like to expand it to support tables with a compound
key -- especially the avatar, reply, and fave tables.
* The structure of Action sub-classes makes us re-fetch some data
more than once per site hit. It would be nice to store data in
instance variables once, at the beginning of each action. I want
to add a new method, init($args), which sets up the instance
attributes based on arguments. (Like: "$this->user =
User::staticGet('nickname', $this->arg('nickname'));").
* Laconica currently sucks at handling If-Modified-Since requests.
I'd like each action to have a last_modified() method, which
returns a Unix timestamp for the last time the page was
modified. So, say, ShownoticeAction would take the maximum of:
the modified date of the notice, the modified date of the
author's profile, the modified date of the user's profile (for
language and timezone), the modified date of the author's
avatar. We'd also want to have an "epoch" date, sitewide,
probable based on the maximum of the mtime of common.php (when
the software was installed) and config.php (last configuration
change), but configurable by the user. We can then add
Last-Modified: headers to outgoing pages, and the
Action::handle() method can compare the results of
last_modified() with the If-Modified-Since header and return a
304 response if it's not needed.
* As another optimization point, we might want to start supporting
the ETag header for output and the If-None-Match for cache
comparison. Again, similar to last-modified, we can add an
etag() method, and do comparison in the Action::handle() base
class.
* Current queue handlers are based on an admittedly lame homebrew
queueing strategy. The Web front end stuffs things into a
queue_item table in the database, and the queue handlers
constantly requery it to see if there are any new queue_item's.
I'd like to keep that as an option, but also optionally support
queueing using a STOMP server, too. I think that would seriously
clear up latency for XMPP messages (e.g.) as well as general
processing.
* Per Rasmus's review at OSCON 2008, we're getting something like
a 20% performance hit from doing our output through XMLWriter
rather than just using print (or echo!) statements. changing the
common_element() method and its compatriots to use simple
printed output instead would be a great optimization.
(Eventually, by the way, I'd like to take that little cluster of
output functions and push them into the Action class.)
* We need to start having some unit tests. Zach and I settled on
SimpleTest (http://simpletest.org/ ) which seems to be the most
modern and best-maintained PHP unit-testing framework out there.
I think the more tests the better, so we can get this process
started over the weekend, too.
Anyways, I hope that people who are into Laconica consider hacking with
me this weekend. I think it's got an opportunity to be really fun.
-Evan
--
Evan Prodromou <[EMAIL PROTECTED]>
Control Yourself, Inc.
_______________________________________________
Laconica-dev mailing list
[email protected]
http://mail.laconi.ca/mailman/listinfo/laconica-dev