Giter VIP home page Giter VIP logo

sort's Introduction

Sort

Exploring and challenging most sorting algorithms in javascript.

Below I will list the results of some tests ran on different benchmarks. What matters here is the size of the input array, and its content. As You will see comparing the outcomes of different node versions, the Array.prototype.sort got better in the most recent one (actually from 11.x.x).

The strategy named native in the tables below is the Array.prototype.sort function which turns surprisingly to not be the fastest solution, at least when not using an up to date node version. Another reason to keep your node up to date.
For curiosity I also added lodash using the _.sort_by function.

Performance outcome in milliseconds:

Env: MacBook Pro, 2.5 GHz Dual-Core Intel Core i7, 16 GB 2133 MHz LPDDR3

stats On node v10.14.1

stats On node v12.16.1

sort's People

Contributors

fedeghe avatar dependabot[bot] avatar

Stargazers

Stefan Novaković avatar

Watchers

James Cloos avatar  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.