Giter Club home page Giter Club logo

linkedom-test's Introduction

This is a comparison of using emerging super fast tools vs defacto tools in our ecosystem.

The following setup hasn't been optimized in any way and it shows that we can have huge performance boosts by challenging the status quo.

I didn't do anything special here except collecting pieces of the puzzle. And all the credit goes to the brains behind these amazing projects:

  • esbuild ±100x faster than other bundlers
  • uvu way faster and simpler (loc) but also less feature rich (that's one more feature) than other testing libraries
  • linkedom ±10x faster than JSDOM.

The fastest way to try this setup is through repl.it

Here are the detailed results of this benchmark without using npm:

uvu + linkeDOM + esbuild

➜  linkedom-test git:(main) /usr/bin/time node_modules/.bin/uvu src/__tests__ -r esbuild-register
counter.tsx
• • • •   (4 / 4)

  Total:     4
  Passed:    4
  Skipped:   0
  Duration:  48.68ms

        0.34 real         0.27 user         0.07 sys

jest + jsdom + babel

➜  linkedom-test git:(main) /usr/bin/time node_modules/.bin/jest
 PASS  src/__jest__tests__/counter.test.tsx
  TEST
    ✓ should render with "5" by default (31 ms)
    ✓ should accept custom `count` prop (9 ms)
    ✓ should increment count after `button#incr` click (22 ms)
    ✓ should decrement count after `button#decr` click (19 ms)

Test Suites: 1 passed, 1 total
Tests:       4 passed, 4 total
Snapshots:   0 total
Time:        1.736 s, estimated 2 s
Ran all test suites.
        2.40 real         2.43 user         0.43 sys

Comparison table

Real (s) User (s) Sys (s)
Jest + jsdom + babel 2.40 0.40 0.43
uvu + linkedom + esbuild 0.34 0.27 0.04
Comparison x7 x1.4 x10.75

These results are the best over 3 runs on a tired Macbook Air

MacBook Air (13-inch, Early 2015)
2.2 GHz Dual-Core Intel Core i7
8 GB 1600 MHz DDR3

linkedom-test's People

Contributors

haikyuu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

gkiely

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.