uWSGI's FastFuncs
Fast Functions are a way to pratically cancel the overhead of the request parsing for content that does not need request data (method, uri, headers....).
For example your homepage does not need to know what method is used, what headers are used and so on. Why pass all those useless data ?
With the fastfuncs tuple of the uwsgi class you can define a list of up to 256 callable that you can call using only the uwsgi packet header:
def myfasthomepage():
uwsgi.start_response('200 OK', [('Content-Type', 'text/html')])
yield "<h1>This is the fastest homepage of the world !!!</h1>"
def afastpage():
uwsgi.start_response('200 OK', [('Content-Type', 'text/html')])
yield "<h3>Hello World</h3>"
uwsgi.fastfuncs.insert(0, afastpage)
uwsgi.fastfuncs.insert(1, myfasthomepage)
The uwsgi modifier for fastfuncs is 26 and you will use the second modifier to select which callable to launch.
The following 4 byte uwsgi request will execute the myfasthomepage() callable
26|0|0|1
