Commit Graph

74 Commits

Author SHA1 Message Date
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
Felipe Lessa
20f51e38e2 yesod-core: Doc improvements for runFakeHandler. 2012-08-21 13:38:49 -03:00
Felipe Lessa
0346dab14c yesod-core: New function runFakeHandler. 2012-08-21 13:38:42 -03:00
Michael Snoyman
c009067b11 DontFullyEvaluate (Felipe's code) 2012-07-25 08:54:43 +03:00
Michael Snoyman
f91ff4fde2 fullyEvaluateBody 2012-07-24 17:49:17 +03:00
Michael Snoyman
33c39662b9 Reflect wai changes for #262 2012-07-11 15:58:36 +03:00
Michael Snoyman
288f3b36eb fast-logger/monad-logger 0.2 2012-07-09 14:14:45 +03:00
Michael Snoyman
29c242d03b monad-logger 2012-07-05 16:14:23 +03:00
Michael Snoyman
ddd1059983 Updated fast-logger/wai-logger 2012-07-05 11:04:04 +03:00
Michael Snoyman
8fac4917b5 FileUpload (#358) 2012-07-02 11:15:02 +03:00
Michael Snoyman
3ecbf43f5d $newline 2012-07-01 20:59:37 +03:00
Michael Snoyman
d465d30863 Remove some blaze conditionals 2012-06-26 22:54:12 +03:00
Michael Snoyman
4a6e027d29 maximumContentLength is Word64 (#365) 2012-06-26 22:52:56 +03:00
Felipe Lessa
68001ed057 Fix a fixme comment. 2012-04-24 09:55:47 -03:00
Michael Snoyman
4bb2c33bfe yesod-core for blaze-html 0.5 2012-04-23 11:12:02 +03:00
Michael Snoyman
4ac413e419 Configurable session name 2012-04-07 23:01:29 +03:00
Luite Stegeman
396644081c make SessionBackend more flexible 2012-03-31 01:36:44 +02:00
gregwebs
3f0848121c Session -> BackendSession 2012-03-25 13:31:02 -07:00
gregwebs
3bb3db16b1 Revert "fix Session export"
This reverts commit 03634a13b8.
2012-03-25 13:31:02 -07:00
gregwebs
2baeddd698 fix doctype 5 2012-03-25 08:21:21 -07:00
gregwebs
b1bc42a8bd use doctype 5 instead of !!! 2012-03-25 07:49:35 -07:00
gregwebs
03634a13b8 fix Session export 2012-03-25 07:49:35 -07:00
Michael Snoyman
d7b515cd5b Fix an extra close angle bracket 2012-03-23 17:34:26 +02:00
Michael Snoyman
1f1c6ca9d4 Fixes 2012-03-23 16:02:50 +02:00
Felipe Lessa
9cd7a0ba14 Add cookieDomain to Yesod type class. 2012-03-21 14:36:46 -03:00
Felipe Lessa
1216c472c7 Remove trailing whitespace. 2012-03-21 14:36:30 -03:00
Michael Snoyman
ec62f6f68c nonce -> token (#214) 2012-03-16 06:39:30 +02:00
Michael Snoyman
e0fda35a55 Removed deprecated methods from Yesod typeclass 2012-03-13 21:46:06 +02:00
Michael Snoyman
ee81979430 Merge remote-tracking branch 'origin/master' into beta 2012-03-13 15:14:49 +02:00
Michael Snoyman
e62e4b8721 Finished deprecating old Widget functions 2012-03-13 13:11:05 +02:00
Luite Stegeman
00b9acd98d merge master branch 2012-03-13 11:02:33 +01:00
Michael Snoyman
cbd0719f37 conduit 0.3 2012-03-12 13:40:04 +02:00
Greg Weber
ffaa1d6a32 favor BottomOfBody 2012-02-26 16:41:15 -08:00
Michael Snoyman
4c21c092ab Fix Haddocks (#277) 2012-02-21 15:17:36 +02:00
Greg Weber
9b8b20e058 tests and better docs for jsLoader 2012-02-16 16:11:10 -08:00
Greg Weber
651a1f8abd more flexible js loading
* write your own async jsLoader widget.
* Suport loading from the bottom of body tag.

Bottom of the page is actually the best default until you profile your
application.
2012-02-12 08:11:45 -08:00
Luite Stegeman
32d5c3f5f1 Improve makeSessionBackend documentation 2012-02-11 20:37:40 +01:00
Luite Stegeman
a37beb3447 Add encryptKey and clientSessionDuration for 0.10 compatibility 2012-02-11 20:33:26 +01:00
Luite Stegeman
b5b27f2b15 Make session storage configurable 2012-02-10 19:22:31 +01:00
Michael Snoyman
4dd9880389 Approot 2012-02-09 09:08:06 +02:00
Greg Weber
b7924975b0 yepnope loads in the <head>. closes #257
previous commit just put modernizr/yepnope in the head
2012-02-08 10:06:44 -08:00
Greg Weber
91d6a121d6 Revert "yepnope/modernizr is included in <head> (#256)"
This reverts commit 3b59c48dbc.
2012-02-08 10:04:57 -08:00
Michael Snoyman
3b59c48dbc yepnope/modernizr is included in <head> (#256) 2012-02-07 16:37:02 +02:00
Michael Snoyman
935912f31c cookie 0.4 2012-02-06 14:36:15 +02:00
Greg Weber
704892bdda lengthen variable names 2012-02-01 23:15:36 -06:00
Michael Snoyman
2f38ddaff3 Temporarily remove sessionIpAddress (#243) 2012-01-31 06:53:47 +02:00
Michael Snoyman
4962529006 sessionIpAddress False by default (#243) 2012-01-30 13:01:34 +02:00
Michael Snoyman
b86b2cb75e Fix warning 2012-01-30 07:16:04 +02:00
Pär-Anders Aronsson
4796ad77d4 Generalized cookie handling.
Signatures for setCookie & deleteCookie changed.
Helper function getExpires added to API.
2012-01-29 21:05:01 +01:00
Michael Snoyman
fec0d42827 lookupSessionBS/setSessionBS (#235) 2012-01-24 18:43:30 +02:00