yesod/yesod-core
Felipe Lessa b2a9beba3c Use a cache for session cookie's expiration time.
The following HelloWorld app was used as benchmark:

  data HelloWorld = HelloWorld
  mkYesod "HelloWorld" [parseRoutes|
    / HomeR GET
  |]

  instance Yesod HelloWorld where
    -- makeSessionBackend = const $ return Nothing

  getHomeR = return . RepPlain . toContent $ "Hello World!"

  main :: IO ()
  main = warp 8080 HelloWorld

The benchmark was tested with httperf under the following
environments:

  [vanilla-nosession] Released yesod-core 1.1.1.1, but without sessions.

  [vanilla-session] Released yesod-core 1.1.1.1 (with sessions).

  [faster-session-1] With patch 065e33a, "Faster, leaner
  implementation of putTime/getTime".

  [faster-session-2] With this commit.

Performance results:

  A) Testing with:
       httperf --hog --client=0/1 --server=localhost \
               --port=8080 --uri=/ --rate=1000 \
               --send-buffer=4096 --recv-buffer=16384 \
               --num-conns=100 --wsess=1000,60,1 \
               --burst-length=20 --session-cookie

     Results:
       vanilla-nosession: 19187.7 req/s (0.1 ms/req)
       vanilla-session:    2523.3 req/s (0.4 ms/req)
       faster-session-1:   2933.5 req/s (0.3 ms/req)
       faster-session-2:   2957.5 req/s (0.3 ms/req)

     This test benchmarks both saving and loading the session.
     Interestingly, this commit provides only a small performance
     increase.

  B) Testing with:
       httperf --hog --client=0/1 --server=localhost \
               --port=8080 --uri=/ --rate=1000 \
               --send-buffer=4096 --recv-buffer=16384 \
               --num-conns=100 --num-calls=1000 \
               --burst-length=20

     Results:
       vanilla-nosession: 43548.7 req/s (0.0 ms/req)
       vanilla-session:    3609.4 req/s (0.3 ms/req)
       faster-session-1:   3454.9 req/s (0.3 ms/req)
       faster-session-2:   3786.9 req/s (0.3 ms/req)

     This test benchmarks only saving the session.  Strangely,
     faster-session-1 was worse than vanilla-session (while
     isolated tests show that the new putTime should be +70x
     faster).  However, there is a non-negligible performance
     increase on faster-session-2.
2012-09-05 01:35:10 -03:00
..
bench Remove a painful slowdown from randomIV 2011-11-25 15:11:15 +02:00
static Add 'yesod-core/' from commit '982d6185bee75b078bee92bd8a2e8743707f1922' 2011-07-22 08:59:56 +03:00
test hspec 1.3 2012-08-03 15:40:36 +03:00
Yesod Use a cache for session cookie's expiration time. 2012-09-05 01:35:10 -03:00
.gitignore Add 'yesod-core/' from commit '982d6185bee75b078bee92bd8a2e8743707f1922' 2011-07-22 08:59:56 +03:00
bench.sh Remove a painful slowdown from randomIV 2011-11-25 15:11:15 +02:00
helloworld.hs Updated fast-logger/wai-logger 2012-07-05 11:04:04 +03:00
LICENSE Update license with MIT license 2012-04-29 09:38:45 +03:00
README Add 'yesod-core/' from commit '982d6185bee75b078bee92bd8a2e8743707f1922' 2011-07-22 08:59:56 +03:00
Setup.lhs Add 'yesod-core/' from commit '982d6185bee75b078bee92bd8a2e8743707f1922' 2011-07-22 08:59:56 +03:00
test.hs hspec 1.3 2012-08-03 15:40:36 +03:00
widget-benchmark.hs Add 'yesod-core/' from commit '982d6185bee75b078bee92bd8a2e8743707f1922' 2011-07-22 08:59:56 +03:00
yesod-core.cabal yesod-core: Bump version to 1.1.1.1. 2012-08-27 14:50:11 -03:00

Learn more at http://docs.yesodweb.com/