Giter Site home page Giter Site logo

Sinatra is slower than Camping about camping HOT 9 CLOSED

camping avatar camping commented on June 1, 2024
Sinatra is slower than Camping

from camping.

Comments (9)

rtomayko avatar rtomayko commented on June 1, 2024

Yeah. The rps for sinatra definitely looks low. Could be the static file check on each request. There's also MethodOverride, ShowExceptions and a few other middleware added by default. I'll play with tuning it sometime this weekend and see what I can figure out.

from camping.

DAddYE avatar DAddYE commented on June 1, 2024

Added here http://github.com/DAddYE/web-frameworks-benchmark also benches with rendering. Some results:

  # Advanced render
  Padrino => 731.75 rps
  Sinatra => 706.52 rps
  Merb    => 480.03 rps
  Rack    => 253.23 rps
  Rails   => 207.85 rps
  Ramaze  => 177.13 rps
  Camping => 155.96 rps
  # Basic render
  Merb    => 1512.85 rps
  Rack    => 1502.72 rps
  Padrino => 1390.95 rps
  Sinatra => 1113.27 rps
  Camping => 960.18 rps
  Rails   => 337.53 rps
  Ramaze  => 256.69 rps

There are few reason why sinatra seems slower one of them is for example logger.

Then there are one small pseudo-critical problem (but is not here the place).

from camping.

DAddYE avatar DAddYE commented on June 1, 2024

Updated results.

from camping.

judofyr avatar judofyr commented on June 1, 2024

Just so everybody knows: In these rendering examples, Camping uses Markaby while the others uses Haml. I believe Camping is faster than Sinatra when we'll get Haml support (see #18).

from camping.

judofyr avatar judofyr commented on June 1, 2024

With the latest gem install camping --source http://gems.judofyr.net/ and my benchmark fork, it gets even worse:

# Text render
Rack => 2737.31 rps
Camping => 2008.31 rps
Sinatra => 1378.25 rps

# Template render
Rack => 2616.19 rps
Camping => 1489.69 rps
Sinatra => 978.52 rps

# More advanced example
Rack => 1284.13 rps
Camping => 1255.25 rps
Sinatra => 797.33 rps

from camping.

judofyr avatar judofyr commented on June 1, 2024

Hm, apparently Sinatra should run faster with:

disable :static 
disable :logging

I tried it on the more_advanced example and couldn't really notice a difference. Oh well, some of you Sinatra guys will have to figure that out.

from camping.

rtomayko avatar rtomayko commented on June 1, 2024

I tuned the text_render Sinatra benchmark a bit. Before:

Rack => 3415.93 rps
Sinatra => 1990.83 rps

After:

Rack => 3284.83 rps
Sinatra => 2550.25 rps

Here are the changes

from camping.

rtomayko avatar rtomayko commented on June 1, 2024

Tuned the more_advanced Sinatra benchmark a bit too. Before:

Rack => 1900.21 rps
Sinatra => 899.0 rps

After:

Rack => 1873.83 rps
Sinatra => 1107.38 rps

Changes here

from camping.

judofyr avatar judofyr commented on June 1, 2024

Excellent. I've merged your changes, fixed Rack performance and updated Camping to 2.1: http://github.com/judofyr/web-frameworks-benchmark. I've sent the Padrino guys a pull-request, so hopefully they will redo the benchmark.

Closing this for now!

from camping.

Related Issues (20)

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.