Commit Graph

273 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
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
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
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
Michael Snoyman
2e87e13347 Filter missing files (#403) 2012-08-12 17:36:26 +03:00
Michael Snoyman
df5018a94c hspec 1.3 2012-08-03 15:40:36 +03:00
Michael Snoyman
da33be529d Deprecated addWidget 2012-08-03 07:38:21 +03:00
Michael Snoyman
b0c6651ac6 Strictness annotations on Content 2012-07-25 08:56:46 +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
fffb3028c9 Export FileUpload (#262) 2012-07-09 15:11:24 +03:00
Michael Snoyman
288f3b36eb fast-logger/monad-logger 0.2 2012-07-09 14:14:45 +03:00
Michael Snoyman
f3a3408260 http-types 0.7 2012-07-06 16:24:24 +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
9fdb8c9d2d Field names for GWData 2012-07-04 17:53:47 +03:00
Michael Snoyman
7c4d6b5e47 Javascript in Head (#380) 2012-07-04 17:53:24 +03:00
Michael Snoyman
d38e9a8c0a FileUploadSource (#262) 2012-07-02 11:21:02 +03:00
Michael Snoyman
7efbab8846 Explicit exports for FileInfo fields 2012-07-02 11:20:17 +03:00
Michael Snoyman
8fac4917b5 FileUpload (#358) 2012-07-02 11:15:02 +03:00
Michael Snoyman
e8fb512107 Allow sitewide hamlet changes (#377) 2012-07-02 09:37:56 +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
Michael Snoyman
014732dac8 hspec 1.2 2012-06-26 10:56:50 +03:00
Michael Snoyman
ebc737a5cb conduit 0.5 2012-06-22 15:28:14 +03:00
Michael Snoyman
61b5627e44 Version bumps 2012-05-14 12:33:44 +03:00
Michael Snoyman
d0a7447f56 Remove containers upper bounds 2012-05-09 10:25:19 +03:00
Michael Snoyman
468b013860 Turn on blaze-html 0.5 by default 2012-05-09 09:50:37 +03:00
Simon Hengel
653ffd02fb yesod-core: Adapt tests for hspec-1.1
This is not strictly necessary, the `UnevaluatedSpec` is merely
deprecated.  But it is a good idea anyway.
2012-05-07 07:43:28 +02:00
Mark Wright
9f4c92f181 yesod-core changes for hspec 1.0 2012-05-06 12:18:49 +10:00
Michael Snoyman
e18c678aed Remove upper bounds on bytestring (yesodweb/shakespeare#60) 2012-04-29 09:38:45 +03:00
Michael Snoyman
20015aa6ee Update license with MIT license 2012-04-29 09:38:45 +03:00
Michael Snoyman
12f530a1e7 Remove ghc7 flag (#322) 2012-04-25 17:20:38 +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
a4920c46ca Version bumps 2012-04-19 07:57:43 +03:00
Mark Wright
f7b0f6ce12 Include missing test files and sort the list of test files 2012-04-16 21:10:52 +10:00
Michael Snoyman
74a826fbb4 clearSession 2012-04-10 18:56:30 +03:00
gregwebs
ba4cd002e1 documentation cleanup 2012-04-09 05:54:53 -07:00
Anton
09c461dd89 add additional documentation for language function 2012-04-09 14:02:09 +06:00
Michael Snoyman
285c3497f4 Version bump 2012-04-09 10:16:06 +03:00
Michael Snoyman
4ac413e419 Configurable session name 2012-04-07 23:01:29 +03:00