Giter Club home page Giter Club logo

performance-test's Introduction

Comparing performance of a simple model-load and show between yesod 0.7 and rails 2.3

Results
-------

Rails (in production mode, running with mongrel webserver, ruby 1.8.7) is six times slower than yesod (compiled in production mode).

Rails, development mode:

ransactions:                     250 hits
Availability:                 100.00 %
Elapsed time:                  26.82 secs
Data transferred:               5.53 MB
Response time:                  0.53 secs
Transaction rate:               9.32 trans/sec
Throughput:                     0.21 MB/sec
Concurrency:                    4.96
Successful transactions:         250
Failed transactions:               0
Longest transaction:            0.59
Shortest transaction:           0.17


Rails, production mode

ransactions:                     250 hits
Availability:                 100.00 %
Elapsed time:                  22.37 secs
Data transferred:               5.53 MB
Response time:                  0.44 secs
Transaction rate:              11.18 trans/sec
Throughput:                     0.25 MB/sec
Concurrency:                    4.97
Successful transactions:         250
Failed transactions:               0
Longest transaction:            0.52
Shortest transaction:           0.15



Yesod, old (hamlet <0.7.3, 14 times slower than rails):

ransactions:                     250 hits
Availability:                 100.00 %
Elapsed time:                 377.51 secs
Data transferred:               0.79 MB
Response time:                  7.55 secs
Transaction rate:               0.66 trans/sec
Throughput:                     0.00 MB/sec
Concurrency:                    5.00
Successful transactions:         250
Failed transactions:               0
Longest transaction:            8.35
Shortest transaction:           7.02


Yesod, updated Version (hamlet 0.7.3):

ransactions:                     250 hits
Availability:                 100.00 %
Elapsed time:                  82.29 secs
Data transferred:               0.79 MB
Response time:                  1.64 secs
Transaction rate:               3.04 trans/sec
Throughput:                     0.01 MB/sec
Concurrency:                    4.99
Successful transactions:         250
Failed transactions:               0
Longest transaction:            1.74
Shortest transaction:           1.36


Yesod, updated again (persistent-postgresql 0.4.0.1)

ransactions:                     250 hits
Availability:                 100.00 %
Elapsed time:                   3.70 secs
Data transferred:               0.37 MB
Response time:                  0.07 secs
Transaction rate:              67.57 trans/sec
Throughput:                     0.10 MB/sec
Concurrency:                    4.78
Successful transactions:         250
Failed transactions:               0
Longest transaction:            0.14
Shortest transaction:           0.05


To reproduce results
--------------------

You will need a PostgreSQL Server, Rails and Yesod installed.

1. Create a Database called "haskell"
2. Import SQL dump

   psql haskell < data.sql

3. Configure the database connection by editing rails-test/config/database.yml

4. In the rails-test directory start the server

   ./script/server

5. Access http://localhost:3000 and measure the time it takes to get 1000 quotes and display the values

6. Configure the database connection by editing yesod-test/Settings.hs (make sure to set the production settings)

7. In the yesod-test directory compile the app in production mode

   cabal install -f "production"

8. Start the app ./dist/build/yesod-test-production/yesod-test-production

9. Access http://localhost:3000/quotes and measure the time it takes to get 1000 quotes and display the values


Testing with siege:

siege -b -c 5 -r 50 localhost:3000

performance-test's People

Contributors

skoschnicke avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.