Coder Social home page Coder Social logo

view-layer-benchmarks's Introduction

Purpose

To document performance of ViewComponent, Rails Partials, Dry-View, Trailblazer Cells, Papercraft and Phlex Components.

Benchmarks

Benchmarks arent representative of real life and just render nested components / partials. Take all numbers with a grain of salt.

Contributing

Feel free to submit a PR for optimization of views and other use-cases / view layers.

Setup

git clone https://github.com/paramagicdev/view-layer-benchmarks.git
cd view-layer-benchmarks
bundle install
bundle exec rake benchmark

Benchmarks are for Ruby 3.2.2 and Rails v7.1.

Warming up --------------------------------------
      view_component   906.000  i/100ms
            partials   446.000  i/100ms
               cells   498.000  i/100ms
            dry_view    46.000  i/100ms
               phlex     3.028k i/100ms
          papercraft     1.730k i/100ms
Calculating -------------------------------------
      view_component      8.969k (± 0.6%) i/s -     89.694k in  10.000780s
            partials      4.347k (± 2.0%) i/s -     43.708k in  10.058462s
               cells      4.699k (± 3.1%) i/s -     47.310k in  10.078038s
            dry_view    441.518  (± 2.3%) i/s -      4.416k in  10.007041s
               phlex     28.745k (± 1.1%) i/s -    287.660k in  10.008481s
          papercraft     16.392k (± 2.1%) i/s -    164.350k in  10.030574s

Comparison:
               phlex:    28745.1 i/s
          papercraft:    16392.3 i/s - 1.75x  (± 0.00) slower
      view_component:     8969.1 i/s - 3.20x  (± 0.00) slower
               cells:     4699.0 i/s - 6.12x  (± 0.00) slower
            partials:     4347.2 i/s - 6.61x  (± 0.00) slower
            dry_view:      441.5 i/s - 65.11x  (± 0.00) slower```

view-layer-benchmarks's People

Contributors

konnorrogers avatar joeldrapper avatar blocknotes avatar megatux 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.