npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

merge-benchmarks

v1.0.3

Published

A simple project to benchmark various object merge methods

Downloads

7

Readme

Merge Benchmarks

This is a simple microbenchmark suite to test various object merging modules. It is up to the viewer to make judgements on the results. Links to each tested module is provided so that the viewer can easily research each module. Not all modules merge objects in the same manner (i.e. they produce different results).

Pull requests with new tests are welcomed.

Modules Tested

Methodology

Each module is benchmarked against two data sets. Each data set is taken from the json.org example data. The examples used are:

  1. The menu example
  2. The webapp example

Each module is used to merge each respective data set into an empty object ({}). This is done 100,000 times per data set while measuring the time it takes to perform the set of all iterations.

Results

System: Darwin/darwin x64 17.3.0 ~ Intel(R) Core(TM) i7-3720QM CPU @ 2.60GHz (cores/threads: 8)
┌──────────────────────────┬───────────────────────────────┬───────────────────────────────┐
│ method                   │ menu                          │ webapp                        │
├──────────────────────────┼───────────────────────────────┼───────────────────────────────┤
│ Object.assign            │ 0 s, 24.64 ms (24646087 ns)   │ 0 s, 18.53 ms (18536173 ns)   │
├──────────────────────────┼───────────────────────────────┼───────────────────────────────┤
│ conflate                 │ 0 s, 21.10 ms (21105143 ns)   │ 0 s, 24.4 ms (24465780 ns)    │
├──────────────────────────┼───────────────────────────────┼───────────────────────────────┤
│ deepmerge                │ 0 s, 288.23 ms (288238882 ns) │ 1 s, 175.77 ms (175778962 ns) │
├──────────────────────────┼───────────────────────────────┼───────────────────────────────┤
│ extend                   │ 0 s, 6.91 ms (6914505 ns)     │ 0 s, 13.32 ms (13327417 ns)   │
├──────────────────────────┼───────────────────────────────┼───────────────────────────────┤
│ extend (deep copy)       │ 0 s, 289.21 ms (289218295 ns) │ 1 s, 488.82 ms (488822487 ns) │
├──────────────────────────┼───────────────────────────────┼───────────────────────────────┤
│ lodash.merge             │ 0 s, 489.42 ms (489422631 ns) │ 1 s, 609.33 ms (609338347 ns) │
├──────────────────────────┼───────────────────────────────┼───────────────────────────────┤
│ merge                    │ 0 s, 36.06 ms (36064161 ns)   │ 0 s, 38.09 ms (38092761 ns)   │
├──────────────────────────┼───────────────────────────────┼───────────────────────────────┤
│ merge (cloned recursive) │ 0 s, 237.49 ms (237493493 ns) │ 1 s, 465.54 ms (465540849 ns) │
├──────────────────────────┼───────────────────────────────┼───────────────────────────────┤
│ merge-deep               │ 0 s, 513.93 ms (513938722 ns) │ 2 s, 552.82 ms (552826239 ns) │
├──────────────────────────┼───────────────────────────────┼───────────────────────────────┤
│ merge-options            │ 0 s, 721.07 ms (721070882 ns) │ 1 s, 986.48 ms (986488819 ns) │
└──────────────────────────┴───────────────────────────────┴───────────────────────────────┘

License

MIT License