Commit Graph

2148 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
065e33a3d1 Faster, leaner implementation of putTime/getTime.
Benchmark on my computer (per call, includes runPut/runGet):

    old putTime: 5658 ns +/- 224ns
    new putTime:  821 ns +/-  24ns (7x faster)

    old getTime: 7228 ns +/- 126ns
    new getTime:   99 ns +/-   4ns (73x faster!!)

Besides, the old format used 25 raw bytes (33.3 bytes on the
base64 output), while the new one uses 8 bytes (10.6 bytes on the
base64 output).
2012-09-05 00:41:54 -03:00
Michael
498d22714b checkMMod to checkMMap (#416) 2012-09-04 17:57:05 +03:00
Michael Snoyman
4cce1d5a8f Merge remote-tracking branch 'origin/master'
Conflicts:
	yesod-core/yesod-core.cabal
2012-09-03 20:49:50 +03:00
Felipe Lessa
865281d241 yesod-core: Bump version to 1.1.1.1.
Where do I redeem my prize?
2012-08-27 14:50:11 -03:00
Felipe Lessa
0d95e6917d yesod-core: Whitespace. 2012-08-27 14:50:04 -03:00
Felipe Lessa
5b19865c7a yesod-core: In handlerToIO, really avoid keeping old handler data in memory. 2012-08-27 10:20:17 -03:00
Hiromi Ishii
933ad50ac3 caught up with yesod 1.1 2012-08-25 14:54:59 +09:00
Michael Snoyman
dea07e8d4d Merge pull request #412 from yogsototh/patch-1
Added example on AddHandler to avoid confusion
2012-08-23 08:17:34 -07:00
Yann Esposito
667d8405a8 Added example on AddHandler to avoid confusion
I used the add-handler command of Yesod, and I found the sentences were too ambiguous. In order to avoid confusion, I just added some examples.

ps: I tried to write "getCommentR" instead of just "GET" and it was transformed in getcommentrCommentR :(.
2012-08-23 14:22:56 +03:00
Michael Snoyman
09016e9b7c Version bumps 2012-08-22 20:06:13 +03:00
Michael Snoyman
6b31b583f2 checkMMod 2012-08-22 20:05:34 +03:00
Michael Snoyman
34db07760a Merge branch 'master' of github.com:yesodweb/yesod 2012-08-22 20:04:11 +03:00
Michael Snoyman
a9b10ce0bc Merge pull request #410 from meteficha/runFakeHandler
New function runFakeHandler.
2012-08-21 21:06:55 -07: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
244eb88f36 Merge pull request #409 from meteficha/handlerToIO
yesod-core: New handlerToIO function.
2012-08-21 04:41:28 -07:00
Felipe Lessa
dc14783c81 yesod-core: On handlerToIO, avoid 'sourceList []'. 2012-08-20 13:13:46 -03:00
Felipe Lessa
786b5bc6e2 yesod-core: On handlerToIO's docs, avoid shadowing a name. 2012-08-20 13:09:43 -03:00
Felipe Lessa
60046bad96 yesod-core: New handlerToIO function. 2012-08-20 13:07:58 -03:00
Felipe Lessa
d94a95da3e Merge pull request #408 from meteficha/yesod-eventsource
New yesod-eventsource package.
2012-08-20 07:44:46 -07:00
Felipe Lessa
927ae17b19 yesod-eventsource: Bump version to 1.0.0.1. 2012-08-20 11:39:53 -03:00
Felipe Lessa
828c99fb7b wai-eventsource: Fix misleading doc on RepEventSource. 2012-08-20 11:39:11 -03:00
Felipe Lessa
93b2c3acf1 wai-eventsource: Avoid mconcat and reverse on ioToRepEventSource. 2012-08-20 11:37:46 -03:00
Felipe Lessa
600fec4852 wai-eventsource: Do not Flush needlessly on ioToRepEventSource. 2012-08-20 11:34:50 -03:00
Felipe Lessa
e0462b294c wai-eventsource: Minor typo. 2012-08-20 11:32:13 -03:00
Michael Snoyman
8b320629b2 yesod-platform 1.1.1 2012-08-20 17:29:25 +03:00
Felipe Lessa
c8abfa15e3 wai-eventsource: Small doc fix. 2012-08-19 15:04:58 -03:00
Felipe Lessa
765fa90eae wai-eventsource: Fix incorrect naming of the Cabal file. 2012-08-19 15:00:35 -03:00
Felipe Lessa
b8b5ec49fb wai-eventsource: Add a Setup.lhs file. 2012-08-19 14:59:16 -03:00
Felipe Lessa
183b640a55 New yesod-eventsource package. 2012-08-19 14:53:15 -03:00
Michael Snoyman
79fcfe0707 Fix stupid bugs... 2012-08-17 07:35:01 +03:00
Michael Snoyman
83b10c4959 yesod devel catches all message file changes (#404) 2012-08-17 07:15:04 +03:00
Michael Snoyman
5da6d0d9ea Scaffolding: allow http-conduit 1.6 (snoyberg/http-conduit#44) 2012-08-15 17:52:46 +03:00
Michael Snoyman
94ca240e5e http-conduit 1.6 (snoyberg/http-conduit#44) 2012-08-15 17:49:39 +03:00
Michael Snoyman
55264b1c6b Version bumps 2012-08-13 20:42:57 +03:00
Michael Snoyman
2e87e13347 Filter missing files (#403) 2012-08-12 17:36:26 +03:00
Felipe Lessa
47917ddd98 Merge pull request #402 from tlaitinen/master
Finnish translation for Yesod.Auth.Message
2012-08-10 04:17:28 -07:00
Tero Laitinen
0d417e5f69 Finnish translation for Yesod.Auth.Message 2012-08-10 12:33:11 +03:00
Michael Snoyman
0e17fcd0b4 Merge remote-tracking branch 'origin/master' 2012-08-08 17:04:59 +03:00
Michael Snoyman
28e0bf88aa Bootstrap friendly radio markup (#394) 2012-08-08 17:04:18 +03:00
Michael Snoyman
5bc6b501b2 Removed blaze-html 0.5 conditionals 2012-08-08 17:03:59 +03:00
Felipe Lessa
8d5cf836a7 Merge pull request #398 from ehamberg/patch-2
Some fixes for Norwegian translation
2012-08-07 14:16:28 -07:00
Erlend Hamberg
7451164451 Some fixes for Norwegian translation
“obligatoriskt” was probably left over from the Swedish translation and should   be “obligatorisk”
“sannhetsverdi” is the established term for a boolean
“Slett?” should be “Slette?” if the orignal string means “[Do you want to ]delete?”
2012-08-08 00:15:17 +03:00
Michael Snoyman
6e0daccfd9 A few yesod-platform changes 2012-08-07 08:21:43 +03:00
Greg Weber
4a1d480998 fix yesod-test scaffold for SQL 2012-08-06 11:21:46 -07:00
Greg Weber
840fa09e5b complete backend independent yesod-test 2012-08-06 11:01:38 -07:00
Greg Weber
25d7c2287d update scripts 2012-08-05 16:03:14 -07:00
Greg Weber
cbfaffe5a1 update yesod-test README 2012-08-05 13:48:50 -07:00
Greg Weber
68779e038d update scripts 2012-08-05 13:35:31 -07:00