I ran across Smisk two days ago and though. "Hmm, someone should write a wsgi adaptor for that".
Maybe an hour after I had that thought, I started working on one. It was pretty easy. Smisk’s classes seem to be inspired by WSGI, all the wsgi environment variables had a Smisk equivilent. So the adaptor was basically putting tab A in Slot B and Tab B is slot A, etc.
If you noticed in my delicious feed. I bookmarked Smisk itself and three hours later, I bookmarked my launchpad branch of smisk-wsgi. Pretty cool.
Fifteen hours later across the globe in Sweeden, Smisk’s project owner Ramus Anderson, merged in my code in with some changes.
So in a total of 3 hours, something went from concept to reality thanks to Python. I don’t think quickness is a testimate to my mad hacking skills. It’s really a testimate to Python’s agility.
So what is Smisk and why is it cool? Smisk is a low level web framework built in C but controled by Python. Basically it’s a lightcgi interface to Python with some really well thought out classes bolted on.
What does the wsgi adapter get you? It basically allows you to expose your wsgi based framework/app (Django, Cherrypy, etc) to fastcgi via C. Now, what does that get you? Well it gets you a faster fastcgi protocol (I think).
Now, I don’t have any quantifiable evidence if it’s actually faster or not. Logic would say it would be. If it is faster, it’s probably in the range of miliseconds, so it’s probably not something to lose sleep over. Generally your application slowdowns deal with IO, database being the largest contributor.
Is the WSGI adaptor compliant? For the most part. I’m doing tests with the wsgiref’s validator app. There are some methods that we have to add to smisk’s Stream class. That means C work, so I have to brush up on my skills, but it shouldn’t be long.
I’m currently running this blog on Django on top of Smisk. I found some nasty bugs (causes segfaults on POST) that were in the Stream class, so I wouldn’t recomend doing the same until Ramus merges the changes I sent him.
Will this replace flup as a fastcgi to wsgi adapter? I doubt it at this point, flup has some nice pooling features that would have to be built into Smisk in order for Smisk to have the flexibility of flup. You can simulate flup’s pooling by enabling a adaptive spawning in lighttpd’s mod_fcgi, but it’s not the same. I don’t know if those features are in Ramus’ plans for Smisk or not.
Comments
Post new comment