Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Zotonic's fork of Basho's webmachine
branch: master

Performance enhancement.

Calling module_info/0 one time is much more expensive than calling
function_exported/3.

From: eprof:

erlang:function_exported/3       22  0.25     7  [      0.32]

erlang:get_module_info/2         1  7.22   267  [    267.00]

Last two numbers are time in and time per call (uS).
latest commit cfbdd16f4f
Maas-Maarten Zeeman mmzeeman authored
Failed to load latest commit information.
demo Removed the -c option from cp, this option is only available in GNU m…
docs Added empty dirs. Recovered default config file.
ebin resource -> controller
include Performance enhancement.
priv Compiles.
scripts Added r1392 from Zotonic svn
src
test
trace Added r1392 from Zotonic svn
www Added webmachine c25ec2dfaba2 tip from http://bitbucket.org/justin/we…
.gitignore Add .rebar to .gitignore
Emakefile Added r1392 from Zotonic svn
LICENSE Added r1392 from Zotonic svn
Makefile Compiles.
README.md More notes.
THANKS Added Arjan and Ben. (github f8a2ef2c62bc61a76aab)
rebar Fix length return value problem in send_parts
rebar.config Remove errors-as-warnings flag.
start-dev.sh Fix start.sh scripts
start.sh Fix start.sh scripts

README.md

webzmachine

Zotonic's Variation

This is a fork of Basho's Webmachine. This fork is done for supporting content management systems with large amounts of dispatch rules and many virtual hosts.

Differences with Basho Webmachine

The main differences with Basho's Webmachine are:

  • Pluggable dispatch handler
  • Support for the HTTP Upgrade
  • Caching of resource callbacks results
  • Dispatch handler can redirect requests
  • Use of process dictionary has been removed
  • webmachine_request is now a normal (non parametrized) module
  • Resources are renamed to controllers.
  • webmachine_controller (ie. webmachine_resource) is now a non-parametrized module
  • Extra logging, also in the event of crashes
  • Use of os:timestamp() instead of now() to prevent locking and time shifts

The first couple of changes gave a significant speed boost to Webmachine.

In the specific case of Zotonic the difference was 5 milliseconds (or more) per request (on a 2GHz Core 2 Duo). Without these optimizations we were not able to use Webmachine.

Something went wrong with that request. Please try again.