webpy/webpy — pull request #215 by daubman (2013-03-12 20:02:39+00:00)
Title: allow the optional use of a path-to-class dict instead of regex-matching all paths, Fixes Issue #214

If you have a constant (no regex matching necessary) set of paths to map, you can now add use_path_dict=True to your:
app = web.application(urls, globals(), use_path_dict=True)
call to use a dict of something like:
{'web.ctx.path-1': class_to_handle_path-1}

rather than avoiding the regex matching against all paths for every call.

While this will have a tiny perf boost, its main benefit is avoiding the non-thread-safe memoization of re_compile discussed in Issue #214

This should be completely transparent and backwards compatible for any users requiring regex matching of paths...