Hi All,
I added Lua benchmarking today, here is a gist w/ the results
https://gist.github.com/673570
The idea was to see
1.) the overhead that calling routines in Lua has
2.) if nested Lua calls were linearly more costly
1M requests on a 3.0GHz CPU
----------------------------------------------------------
SET 89783.27 requests per second
GET 92997.39 requests per second
LUA(set) 50913.95 requests per second
LUA(get) 55218.44 requests per second
LUA(set_session) 25155.99 requests per second
LUA(get_session) 42436.16 requests per second
set_session and get_session are nested routines. set_session does 4
seperate SETs and get_session does 2 GETs (plus some logic).
Lua Overhead: 42%
Nesting costs: better than linear
(linear == 4-to-1 and 2-to-1)
(results are 2-to-1 and 1.3-to-1)
The value of embedding Lua, in this example, is in get_session,
instead of making sequential calls from a web-server to Redisql (which
takes forever in relative terms [6-8 OrderOfMagnitude longer]), the
web-server<->Redisql is a single request w/ sequential logic done
datastore side.
If you can push logic into the Datastore you can cut latency down to
nothing :)
- Jak